Data Series

B

Bill

How can I count the number of data series in an individual chart using VBA? Thanks
 
B

Bernie Deitrick

Bill

ActiveChart.SeriesCollection.Count

You can replace ActiveChart with any valid chart object.

HTH,
Bernie
MS Excel MVP

Bill said:
How can I count the number of data series in an individual chart using
VBA? Thanks
 
B

Bill

I have tried that before and I tried it again. However it says "Count method of SeriesCollection class failed". Any more ideas

----- Bernie Deitrick wrote: ----

Bil

ActiveChart.SeriesCollection.Coun

You can replace ActiveChart with any valid chart object

HTH
Berni
MS Excel MV

Bill said:
How can I count the number of data series in an individual chart usin
VBA? Thank
 
B

Bernie Deitrick

Bill,

A lot of chart stuff only works on on a selected chart: try selecting the
chart first. For a test, select a chart (click on it so that its handles
show), then run this

Sub Test()
Msgbox ActiveChart.SeriesCollection.Count
End Sub

HTH,
Bernie


Bill said:
I have tried that before and I tried it again. However it says "Count
method of SeriesCollection class failed". Any more ideas?
 
B

Bill

That works and I have subsequently solved the problem. thanks

----- Bernie Deitrick wrote: -----

Bill,

A lot of chart stuff only works on on a selected chart: try selecting the
chart first. For a test, select a chart (click on it so that its handles
show), then run this

Sub Test()
Msgbox ActiveChart.SeriesCollection.Count
End Sub

HTH,
Bernie


Bill said:
I have tried that before and I tried it again. However it says "Count
method of SeriesCollection class failed". Any more ideas?
 
Top