chazzerman01
Board Regular
- Joined
- Nov 18, 2019
- Messages
- 65
does anyone know a macro code that will highlight the whole row that the cursor is on. im using it to make it easier to read values in a table
Public OldTarget As Range
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim cell As Range
On Error Resume Next
For Each cell In Range(Cells(OldTarget.Row, "A"), Cells(OldTarget.Row, "O")) ' set range
cell.Interior.Color = Cells(100000, cell.Column).Interior.Color
Next cell
Range(Cells(Target.Row, "A"), Cells(Target.Row, "O")).Interior.Color = RGB(255, 255, 0) 'set the same range as above
Set OldTarget = Target
End Sub