Serving the Quantitative Finance Community

 
User avatar
InMyWoodenHut
Topic Author
Posts: 0
Joined: November 14th, 2003, 3:34 pm

Excel graph. Counting number of series ...

August 27th, 2004, 6:14 am

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
 
User avatar
Monkey
Posts: 1
Joined: July 1st, 2002, 9:42 am

Excel graph. Counting number of series ...

August 27th, 2004, 6:27 am

Try ActiveSheet.ChartObjects(1).Chart.SeriesCollection.CountAssuming you've only got one chart on the worksheetHTH
 
User avatar
InMyWoodenHut
Topic Author
Posts: 0
Joined: November 14th, 2003, 3:34 pm

Excel graph. Counting number of series ...

August 27th, 2004, 6:37 am

I don not know whether it works on your PC ... On mine it doesn't thank you anyway... any other suggestions ?
 
User avatar
InMyWoodenHut
Topic Author
Posts: 0
Joined: November 14th, 2003, 3:34 pm

Excel graph. Counting number of series ...

August 27th, 2004, 8:20 am

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.