VBA Macro to Filter/change Horizontal(Category)Axis Labels

AmplifyMike

New Member
Joined
Sep 4, 2019
Messages
2
Hello everyone. I need some help on this one. I have a data set that is 12 rows x 16 columns. I am Trying to write code that will filter the Horizontal (Category) Axis Labels visible when I chart the data. I have code to filter the Legend Entries (Series) on the chart, but the X-axis seems to be giving me a lot more trouble. Here is the code I used to change the displayed Series, just cycle the False value for each of the series 1-11:

Code:
Sub Channel_Alternative()


'
' Channel Alternative Macro
'
'
    ActiveSheet.ChartObjects("Chart 1").Activate
    ActiveChart.FullSeriesCollection(1).IsFiltered = False
    ActiveChart.FullSeriesCollection(2).IsFiltered = True
    ActiveChart.FullSeriesCollection(3).IsFiltered = True
    ActiveChart.FullSeriesCollection(4).IsFiltered = True
    ActiveChart.FullSeriesCollection(5).IsFiltered = True
    ActiveChart.FullSeriesCollection(6).IsFiltered = True
    ActiveChart.FullSeriesCollection(7).IsFiltered = True
    ActiveChart.FullSeriesCollection(8).IsFiltered = True
    ActiveChart.FullSeriesCollection(9).IsFiltered = True
    ActiveChart.FullSeriesCollection(10).IsFiltered = True
    ActiveChart.FullSeriesCollection(11).IsFiltered = True

Thanks in advance.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,214,983
Messages
6,122,588
Members
449,089
Latest member
Motoracer88

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