Thread: Looping
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
K Dales[_2_] K Dales[_2_] is offline
external usenet poster
 
Posts: 1,163
Default 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....