r/vba • u/JoelSweet_ • 22d ago
Unsolved Highlight active row conditional formatting - stale rows
I've got an expense tracker with a highlight active row (light green fill) using '=ROW()=CELL("row")' on A2:E9999 +
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Me.Calculate
End Sub
On a sheet with only a few rows of data (e.g. rows 1–11), clicking in the blank rows underneath (12, 13, 14…) doesn't repaint properly:
- the old row stays green after you move away, so 2–3 rows are highlighted at once
- the new row is late to highlight, or only a 1-pixel sliver of it gets drawn
- zooming in/out with the trackpad instantly repaints it correctly
Has anyone seen this, or know what Excel's repaint logic is actually doing here?
1
Upvotes
1
u/fanpages 240 22d ago
Suggestion: Use r/Excel's "Focus Cell" feature:
[ https://techcommunity.microsoft.com/blog/microsoft365insiderblog/increase-ease-of-navigation-with-focus-cell-in-excel/4264531 ]
1
u/Emma-Lee_Morin 21d ago
The argument is passed ByVal (by value).