View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Corey Corey is offline
external usenet poster
 
Posts: 276
Default Deleting WorkSheets MANY


Thanks.

Worked a treat

Cheers

Corey....
"JMB" wrote in message
...
This seems to work for me. Backup before trying.

Sub DeleteSheets()
Dim i As Long

On Error Resume Next
Application.DisplayAlerts = False

For i = 3 To Worksheets.Count
Worksheets(CStr(i)).Delete
Next i

Application.DisplayAlerts = True
End Sub


"Corey" wrote:

Application.DisplayAlerts = False
Worksheets("3").Delete
Application.DisplayAlerts = False
Worksheets("4").Delete
Application.DisplayAlerts = False
Worksheets("5").Delete

Is there a way to adapt the above code to simply delete ALL sheets than
2

Tried WorkSheets.Delete"2"
but get an error

Corey....