Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Excel.Range)
- Static OldRng As Range
- On Error Resume Next
- If Application.CutCopyMode = xlCopy Or Application.CutCopyMode = xlCut Then
- OldRng.EntireRow.Interior.ColorIndex = xlColorIndexNone
- Exit Sub
- End If
- Target.EntireRow.Interior.ColorIndex = 6
- If Target.Row = OldRng.Row Then
- OldRng.EntireRow.Interior.ColorIndex = 6
- Else
- OldRng.EntireRow.Interior.ColorIndex = xlColorIndexNone
- End If
- Set OldRng = Target
- Application.CutCopyMode = False
- End Sub
Add Comment
Please, Sign In to add comment