#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Loops

Hello there,

Can anyone help me with a code that delets all series in a certain chart? No
matter how many series there are.

Thanks....

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default Loops

Hannes

For the activechart

Sub deleteSeries()
Dim sc As Series
For Each sc In ActiveChart.SeriesCollection
sc.Delete
Next sc
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"Hannes" wrote in message
...
Hello there,

Can anyone help me with a code that delets all series in a certain chart?
No
matter how many series there are.

Thanks....



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Loops

something like this? Untested

Sub DeleteSeries()
Dim S As Series
For Each S In ActiveSheet.ChartObjects(1).Chart.SeriesCollection
S.Delete
Next
End Sub


--
Don Guillett
SalesAid Software

"Hannes" wrote in message
...
Hello there,

Can anyone help me with a code that delets all series in a certain chart?

No
matter how many series there are.

Thanks....



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Loops

Thanks a lot Nick!

"Nick Hodge" wrote:

Hannes

For the activechart

Sub deleteSeries()
Dim sc As Series
For Each sc In ActiveChart.SeriesCollection
sc.Delete
Next sc
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"Hannes" wrote in message
...
Hello there,

Can anyone help me with a code that delets all series in a certain chart?
No
matter how many series there are.

Thanks....




Reply
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
loops???? harry buggy Excel Worksheet Functions 2 August 14th 07 06:33 PM
Loops SaraJane Excel Discussion (Misc queries) 11 May 26th 07 04:47 AM
Using For - Next Loops in VB Biomed New Users to Excel 4 March 22nd 05 07:12 PM
Do Loops Sue[_5_] Excel Programming 1 May 20th 04 07:51 PM
Loops Snow[_2_] Excel Programming 2 May 13th 04 09:48 PM


All times are GMT +1. The time now is 06:17 PM.

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

About Us

"It's about Microsoft Excel"