Looping
Public Sub DeleteSeries()
Dim XLChart As Chart, XLSeriesCol As SeriesCollection, XLSeries As Series
Set XLChart = Sheets("SheetName").ChartObjects(1).Chart
' above assumes your chart is the first or only one on the worksheet
Set XLSeriesCol = XLChart.SeriesCollection
For Each XLSeries In XLSeriesCol
XLSeries.Delete
Next XLSeries
Set XLSeriesCol = Nothing
Set XLChart = Nothing
End Sub
"Hannes" wrote:
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....
|