Resolved Question: Excel - VBA to highlight cell when row is selected?
I want a cell to be highlighted whenever I select a row. Example highlight C3 if row 3 is selected.
I've been given this and it works;
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveCell.Row = 3 Or ActiveCell.Column = 3 Then
Range("C3").Interior.ColorIndex = 37
Else
Range("C3").Interior.ColorIndex = xlNone
End If
End Sub
How can I make this apply to all rows (eg row 3 highlights C3, row 4 highlights C4, row 5 highlights c5...etc) without using a code for each individual row...
