Reputation: 75
I have a large workbook which generates charts on demand and then deletes them after viewing, then generating a new chart if needed, etc.
I would like to have the "Show Hidden Data" switch turned on by default, as there are many columns of data I wish to hide in the worksheet that are used in the charts. I know I can select this through ChartTools -> Design -> Data but you have to do it for every chart de novo. I cannot get the macro recorder to capture the VBA commands.
Is there a way to code this in VBA when I generate the chart? Thank you.
Upvotes: 0
Views: 1350
Reputation: 75
Apparently, this is the code:
ActiveSheet.ChartObjects("chart_name_here").Activate ActiveChart.PlotVisibleOnly = False
Works on my tests.
Upvotes: 1