Thread: Deleting Sheets
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Deleting Sheets

Hi Jordan
similar to a post 2 hours ago try
----
Public Sub delete_sheets()
Dim wkSht As Worksheet
Application.DisplayAlerts = False
For Each wkSht In Worksheets
If Lcase(trim(wkSht.Name)) < "Control" and
Lcase(trim(wkSht.Name)) _
< "Menu" Lcase(trim(wkSht.Name)) < "Table" Then
wkSht.Delete
End If
Next wkSht
Application.DisplayAlerts = True
End Sub

Frank

Jordan wrote:
Lets say i have a workbook with 20 sheets on it though the
number may vary and I want to delete all sheets which
arent named "Control", "Menu" and "Table"

How could i accomplish this with VBA?