Data Series

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I count the number of data series in an individual chart using VBA? Thanks
 
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
 
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
 
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?
 
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top