View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Wiss Don Wiss is offline
external usenet poster
 
Posts: 300
Default Deleting WorkSheets MANY

On Tue, 4 Jul 2006, 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


Change the 20 to the most possible.

Dim i as Integer
Application.DisplayAlerts = False
On Error Resume Next
For i = 2 to 20
Worksheets(i).Delete
Next i
Application.DisplayAlerts = True

Don <www.donwiss.com (e-mail link at home page bottom).