View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim May Jim May is offline
external usenet poster
 
Posts: 430
Default Delete all sheets after sheet1, but not by sheet name

How bout something like:

Sub DeleteAllButFirst()
Dim i As Integer
Application.DisplayAlerts = False
For Each Sh In Worksheets
If Sh.Index 1 Then
Sh.Delete
End If
Next
Application.DisplayAlerts = True
End Sub

Regards,
Jim May


"Corey" wrote in message
:

is there some code where i can delete all sheets, except for sheet1, but not
by the sheet name.
As the sheet names are not in any particular sequence or indexed value?
Corey....