Loops

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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....
 
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
(e-mail address removed)
 
something like this? Untested

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

Nick Hodge said:
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
(e-mail address removed)
 

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

Similar Threads


Back
Top