Skip to content

Instantly share code, notes, and snippets.

@juwbr
Last active December 13, 2021 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juwbr/f3b575b0de8baa245944f753c2c5b763 to your computer and use it in GitHub Desktop.
Save juwbr/f3b575b0de8baa245944f753c2c5b763 to your computer and use it in GitHub Desktop.
Excel highlight active row
' needs to be added into the worksheet "module" and not in a separate module
Public LastCell
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If (Not (LastCell = "")) Then
Range(LastCell).EntireRow.Interior.Color = RGB(58, 56, 56)
End If
LastCell = ActiveCell.Address
ActiveCell.EntireRow.Interior.Color = RGB(38, 38, 38)
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment