does anyone have a handy code that will cycle through every series collection within a selected chart and "empty" it.. ie delete all of them??
the code i have at the moment is:
Sub emptychart()
Dim scol As Integer, i As Integer
scol = ActiveChart.seriescollection.count
If scol = 0 Then
Exit Sub
Else
Do Until scol = 0
ActiveChart.seriescollection(1).Delete
scol = scol - 1
Loop
End If
End Sub
but it falls over very easily.. i don't know why but when you go to manually delete the series collections then the only one left is called series2... but if u recode deleting it the line is:
ActiveChart.seriescollection(1).Delete
so it should have no problem....
this one has really got me stumped!!
any help...????
Cheers
Ed
the code i have at the moment is:
Sub emptychart()
Dim scol As Integer, i As Integer
scol = ActiveChart.seriescollection.count
If scol = 0 Then
Exit Sub
Else
Do Until scol = 0
ActiveChart.seriescollection(1).Delete
scol = scol - 1
Loop
End If
End Sub
but it falls over very easily.. i don't know why but when you go to manually delete the series collections then the only one left is called series2... but if u recode deleting it the line is:
ActiveChart.seriescollection(1).Delete
so it should have no problem....
this one has really got me stumped!!
any help...????
Cheers
Ed