View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jon Peltier[_7_] Jon Peltier[_7_] is offline
external usenet poster
 
Posts: 115
Default VBA to check if there is a data series in a chart?

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/
_______

JB2004 wrote:

I am trying to create a macro that will update a chart based on a
yes/no pull down menu's. It will grab data from other worksheets if
the pull down menu indicates yes. A total of five data sets are
possible. The problem I have is the logic that would determine if
you need to add a newdata series or if you can overwrite an existing
one. The logic would have to check if a seriescollection(1) or
seriescollection(2)....etc. are there if not create one.