Page 1 of 1

Excel graph. Counting number of series ...

Posted: August 27th, 2004, 6:14 am
by InMyWoodenHut
Hi I would like to count the number of series in an excel graph, through VBA code. I tried the following but it does not work .... (the graph itself is in a sheet) Sheets("myChart").Activate ActiveChart.SeriesCollection.Series.Count Can anyone help me out ? thanx IMWH

Excel graph. Counting number of series ...

Posted: August 27th, 2004, 6:27 am
by Monkey
Try ActiveSheet.ChartObjects(1).Chart.SeriesCollection.CountAssuming you've only got one chart on the worksheetHTH

Excel graph. Counting number of series ...

Posted: August 27th, 2004, 6:37 am
by InMyWoodenHut
I don not know whether it works on your PC ... On mine it doesn't thank you anyway... any other suggestions ?

Excel graph. Counting number of series ...

Posted: August 27th, 2004, 8:20 am
by InMyWoodenHut
ok, I got it. This kind of code only works if the graph is an object in a sheet, and not in a sheet of its own.