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

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,224,743
Messages
6,180,687
Members
452,994
Latest member
Janick

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