G
Guest
Hi all
I need to search through a wookbook for a chart and then if it is there,
delete it. Any ideas as to how to do this? I have tried this but it doesn't
work right.
Set wSheet = Sheets(strSurfPlotName)
If wSheet Is Nothing Then 'Doesn't exist
Set wSheet = Nothing
On Error GoTo 0
Else 'Does exist
Application.DisplayAlerts = False
Charts(strSurfPlotName).Delete
Application.DisplayAlerts = True
Set wSheet = Nothing
On Error GoTo 0
End If
it doesn't search right.
Thanks - Ben H
I need to search through a wookbook for a chart and then if it is there,
delete it. Any ideas as to how to do this? I have tried this but it doesn't
work right.
Set wSheet = Sheets(strSurfPlotName)
If wSheet Is Nothing Then 'Doesn't exist
Set wSheet = Nothing
On Error GoTo 0
Else 'Does exist
Application.DisplayAlerts = False
Charts(strSurfPlotName).Delete
Application.DisplayAlerts = True
Set wSheet = Nothing
On Error GoTo 0
End If
it doesn't search right.
Thanks - Ben H