Is there a way to improve performance in any meaningful way for the following VBA code in Excel?
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Me.Range("Group1"), Target) Is Nothing Then
With wksData
.Range("Group1Column").Value = Target.Column
.Range("Group1Row").Value = Target.Row
End With
End If
End Sub
I've added conditional formatting that looks at the Group1Column and Group1Row named ranges. I can't tell if my performance issue is related to the overkill of SelectionChange or the conditional formatting, but there's a noticeable lag that'd I'd like to get rid of.
The conditional formatting is super basic (something like Column($D3) = Group1Column), and it's only for 'eye-candy' purposes, but it would be helpful for the solution overall.
Some things I've tried: .ScreenUpdating, .EnableEvents, .Calculations. .ScreenUpdating does ensure the user has to wait before selecting their next cell, but not quite what I had in mind.
Any tips would helpful!