SeriesCollection question

E

EAB1977

Very simple question....

Is there a way to get the max number of the SeriesCollection? The
reason I am asking is that I use a date range to properly configure
my chart Based off the dates, I may have different amount if
seriescollections.
 
J

Jon Peltier

I'm not sure what you're asking for. I hope this brackets your question, or
at least gives you a hint.

The maximum number of series in a chart: 255

The number of points in a series:
ActiveChart.SeriesCollection(i).Points.Count

The maximum Y value in a series:
WorksheetFunction.Max(ActiveChart.SeriesCollection(i).Values)

The maximum X value in a series:
WorksheetFunction.Max(ActiveChart.SeriesCollection(i).XValues)

Loop these last two to get the overall max:

For i=1 to ActiveChart.SeriesCollection.Count
If MaxY < WorksheetFunction.Max(ActiveChart.SeriesCollection(i).Values)
Then
MaxY = WorksheetFunction.Max(ActiveChart.SeriesCollection(i).Values)
Then
End If
Next

- Jon
 

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

Top