Re: VBA to check if there is a data series in a chart?

  • Thread starter Thread starter Jon Peltier
  • Start date Start date
J

Jon Peltier

SeriesCollection.Count tells you how many series are present. They are
numbered 1 to N, and if SeriesCollection(i) exists, so does
SeriesCollection(i-1).

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 
Here's one that's a little simpler:

With ActiveSheet.ChartObjects(1).Chart
Do While .SeriesCollection.Count > N
.SeriesCollection(.SeriesCollection.Count).Delete
Loop
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 
Back
Top