jeffmoseler
Well-known Member
- Joined
- Jul 16, 2004
- Messages
- 540
I found this code online that highlights the whole row of whatever row you have selected. It works great except that you can't have any other cell in the entire sheet filled with any color or it disappears when you select another cell. I would like to have this code select the active row, columns A through M only. And when it refreshes to delete all fill colors from A2 to M34. Let me know how I could tweak this to get it to work.
Code:
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