ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Loops (https://www.excelbanter.com/excel-programming/319740-loops.html)

Hannes

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....


Nick Hodge

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....




Don Guillett[_4_]

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....




Hannes

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....






All times are GMT +1. The time now is 02:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com