Hi folks, I was looking for how to highlight the entire row and found in
this forum the VBA code bellow. The problem with such code is that it messed (removed) the all styles in my spreadsheet. So, I've lost all columns styles I had set. I know there is the option to SHIF+SPACE to select the entire row, but does anybody know how to have a code that doesn't remove the colors from columns and so on, so do not mess the style of a spreadsheet.? Thanks.
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
Target.Parent.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