Forum Discussion
perkin_warbeck
May 14, 2021Brass Contributor
In VBA, how can I tell when a chart series point becomes no longer selected
When the user selects a point in a chart series (it's a scatter plot), it triggers an EventChart_Select event. In the event code, I change the appearance of the point so if the user looks away from t...
HansVogelaar
May 15, 2021MVP
You could store the most recently highlighted point in a public variable, and create a "reset" procedure that resets this point. You can then call this from the Worksheet_SelectionChange event procedure and from the Chart_Select event procedure, in the latter case before highlighting a new point if applicable.
perkin_warbeck
May 15, 2021Brass Contributor
The problem is that there is no single event for a selection change. There are two, one for chart and one for the sheet. Which means the reset procedure must be called from two different places. I stopped using global variables in event-driven code because I'm not experienced enough to know how to handle initialization in an event-driven application. So I would probably have reset search the series. That was my original "solution" but I don't like it. It's ugly.