LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Delete Empty Series from Chart

Hi,

I have an Excel file that reads data from an external source and creates an
X-Y chart from the data. Each time the data is read, the number of rows is
different and I need to delete the old data. The chart is created in such a
way that each row is a new series.

In order to delete the old data I have simple loop that goes like this:
For i = 4 To ActiveChart.SeriesCollection.Count
ActiveChart.SeriesCollection(ActiveChart.SeriesCol lection.Count).Delete
Next i
I want to keep the first three series intact all the time.

The problem I have is that if for whatever reason there are any <empty
series in the chart, where the chart has a series pointing to cell that have
been cleared, the Delete method fails and I cannot delete the series using
VBA. I have to delete them manually.

Is there a way I can circumvent this and be able to delete the series with
VBA anyway?

Thanks for your help!!

Fermon
P.S. The real simple answer is to delete the series before I update the
chart, but my users need to have access to the data in the chart and they
could delete some cells to run different scenarios. So this is still a
problem for me...
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I make a Chart data series treat blanks as "Empty" cells XLADLK Charts and Charting in Excel 12 June 9th 08 10:53 PM
Chart series delete all then add new keri Excel Programming 2 December 21st 06 02:48 PM
How can I chart a data series without showing empty cells? Brent Charts and Charting in Excel 1 January 19th 06 03:38 PM
Chart, Series delete event sino Charts and Charting in Excel 1 March 29th 05 01:31 AM
Chart, series delete event over context menue sino Charts and Charting in Excel 0 March 28th 05 12:49 AM


All times are GMT +1. The time now is 01:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"