Edit chart category axis data items visible in VBA

JPL64

New Member
Joined
Nov 8, 2019
Messages
1
HI all,
I have a workbook that crates a group of charts on a single worksheet. Each chart is based on 39 weeks' of data, but I want to show the last 8 weeks only, or be able to switch all the charts to show week 7, 15, 22 etc (it is school data, so weekly for now, but eventually the end of each half-term). I can do this manually by selecting each chart, right-clicking on it and clicking "select data", then in the dialogue box switching each week on or off manually. Can this be done in VBA code? If so, how do I access the chart properties? Can I do it through the chart.categorycollection route? there are twenty charts, so automating this woudl be great, especially as someone else with only operational excel skills will use the workbook. Any help appreciated.
JPL
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,223,705
Messages
6,173,985
Members
452,540
Latest member
haasro02

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top