Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COUNTING SeriesCollections ON ActiveCharts 2

Status
Not open for further replies.

MatthewBell

Technical User
Feb 12, 2003
26
GB
Hello, thanks for looking

I have a load of charts that I regulary Reformat. I would now like to change to sourcedata to include more rows.

I'm planning on doing this with a For Next loop to go through each Series Collection on each chart and extend the ranges.

Before I can do this I need to know how to count the number of SeriesCollections on the ActiveChart so that I can assign the value to a variable for future use.

Easy, surely?

Well not for me, any help will be gratefully received.

Many thanks, Matt
 
For the 1st Chartobject on ActiveSheet (worksheet or other charts collection on the chartsheet):
[tt]ActiveSheet.ChartObjects(1).Chart.SeriesCollection.Count[/tt]

For the basic chart on Chart sheet (active):
[tt]ActiveChart.SeriesCollection.Count[/tt]
 
Matthew - this will tell you how many seriescollections there are in the active chart and then loops thru and msgboxes their names

MsgBox ActiveChart.SeriesCollection.Count
For Each sc In ActiveChart.SeriesCollection
MsgBox sc.Name
Next Rgds
Geoff

Vah! Denuone Latine loquebar? Me ineptum. Interdum modo elabitur
 
Thanks for that.

I probably should have thought to try Count when I wanted to count something really shouldn't I.

Duh!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top