Guest User

Untitled

a guest
Jun 20th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Excel.Range)
  2. Static OldRng As Range
  3.  
  4. On Error Resume Next
  5. If Application.CutCopyMode = xlCopy Or Application.CutCopyMode = xlCut Then
  6. OldRng.EntireRow.Interior.ColorIndex = xlColorIndexNone
  7. Exit Sub
  8. End If
  9.  
  10. Target.EntireRow.Interior.ColorIndex = 6
  11. If Target.Row = OldRng.Row Then
  12. OldRng.EntireRow.Interior.ColorIndex = 6
  13. Else
  14. OldRng.EntireRow.Interior.ColorIndex = xlColorIndexNone
  15. End If
  16. Set OldRng = Target
  17. Application.CutCopyMode = False
  18.  
  19. End Sub
Add Comment
Please, Sign In to add comment