Hi all,
Found the code below on internet in play text (with no "enters).
I tried to turn it into normale code but i get complile error
The code should highlight the current row with a red border when a cell is selected
Found the code below on internet in play text (with no "enters).
I tried to turn it into normale code but i get complile error
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim lRow As Long
Dim lCol As Long
Static lPrevRow As Long
'Restore previous active row to...light blue dotted line
If lPrevRow > 0 Then
Range("A" & lPrevRow, "AK" & lPrevRow).BorderAround Weight:=xlHairline, Color:=RGB(162, 200, 255)
End If
'Highlight current row with a red border
lRow = Target.Row Range("A" & lRow, "AK" & lRow).BorderAround Weight:=xlThin, Color:=RGB(255, 0, 0) lPrevRow = lRow
End Sub
The code should highlight the current row with a red border when a cell is selected