I have a dashboard with multiple pivot charts. A macro controls chart formatting based on numerous criteria. The dataset is huge and frequently changes, so I want to update manually, as needed, on a per-chart basis rather than running on Worksheet_Calculate/_PivotTableUpdate/_PivotTableAfterValueChange/etc. (which would make everything intolerably slow).
The current macro iterates over ActiveChart, so I have to manually activate each chart before clicking the button. My question is: How can I activate the chart above/below/adjacent to the clicked button? I realize that I can make a separate macro for each chart that first activates the chart and then calls the main macro, but I'd much rather just have one script that can figure out the chart of interest based on the button location so it dynamically adapts to new charts/moved charts/changing chart names.
(Also, if there's a better option than using the ApplicationCaller's .Address property, please say so. It was just the most straightforward thing that popped to mind.)
Bookmarks