
Originally Posted by
Viktor86HUN
*EDIT
My sheet is very colorfull, and wouldn't want to re apply those formatting.
Also trying to find the best code, which takes the less performance.
My 2. code if it could be solved, would be great

It depends how colorful your sheet is as to whether this will work for you or not. What the procedure does is color only the uncolored cells in the active row yellow. so if you do not have a lot of uncolored cells, you will not be able to see the highlight very well. Anyway, this workbook (not worksheet) event code, so find the item labeled "ThisWorkbook" in the VB editor's Project list window and double click it to open its code module, then copy/paste this code into it...
Code:
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Application.FindFormat.Clear
Application.ReplaceFormat.Clear
Application.FindFormat.Interior.Color = vbYellow
Application.ReplaceFormat.Interior.Color = xlNone
Cells.Replace "", "", SearchFormat:=True, ReplaceFormat:=True
Application.FindFormat.Clear
Application.ReplaceFormat.Clear
Application.FindFormat.Interior.Color = xlNone
Application.ReplaceFormat.Interior.Color = vbYellow
Target.EntireRow.Replace "", "", SearchFormat:=True, ReplaceFormat:=True
Application.FindFormat.Clear
Application.ReplaceFormat.Clear
End Sub
That's it, go to any worksheet and click a cell.
Like this thread? Share it with others