When I'm using Excel 2010, and I have a certain row selected, if I then tab away to another window or sheet, the row/cell that's highlighted is no longer visible. This is really annoying when looking back at the unfocused window. This there a way to turn this functionality off, so that the row is again highlighted on the unfocused Window?
I would like to suggest use "Workbook Sheet SelectionChange Event" in place of "Workbook_SheetActivate". Because ultimate you need to select a Cell to highlight the Row.
Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Excel.Range) If Target.Cells.Count > 1 Then Exit Sub Application.ScreenUpdating = False Cells.Interior.ColorIndex = 0 With Target .EntireRow.Interior.ColorIndex = 19 End With Application.ScreenUpdating = True End Sub
How it works: Select a Cell the Row will be highlighted. Move to other sheet and when you return to the sheet, you find still the Row is highlighted.
To remove fill colour from the Row you can use this code,
ActiveCell.Interior.ColorIndex = xlNone