Counting # of series on each Y-Axis

ablattel

New Member
Joined
Nov 16, 2011
Messages
13
Hey All,

So I have a macro that can help format series on a graph. One of the things it can do is is switch a series from the 1st Y-Axis to the 2nd and vise versa. The problem is if ALL the series go onto the 2nd axis it can mess up the X-Axis labels. Essentially, I know you can count the number of series in a chart, but I want to be able to count the number of series on each Y-Axis. This way I can figure out if the macro is about to move all of the series over to the 2nd axis and I can throw up a warning message.

Alternatively, is there a way to figure out if any given series is on which axis?

Thanks in advance you any and all help!

Cheers.
 

Some videos you may like

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

ablattel

New Member
Joined
Nov 16, 2011
Messages
13
Thanks! I take it there is no way to have Excel count the number of series on each chart, but instead use this to do it manually?
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Yes, you will need to loop around the SeriesCollection and test which axis each series is on.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,538
Messages
5,625,398
Members
416,100
Latest member
lirongr1996

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
Top