How can I automatically highlight the entire row where an active cell is highlighted without getting rid of other cells that are highlighted? (I want to highlight the entire row when there is an active cell and then un-highlight it when I move away.) t
I know the following VBA code does that but it eliminates all other cells filled with color.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Application.ScreenUpdating = False
' Clear the color of all the cells
Cells.Interior.ColorIndex = 0
With Target
' Highlight the entire row and column that contain the active cell
.EntireRow.Interior.ColorIndex = 8
End With
Application.ScreenUpdating = True End Sub