Thread: Deleting Sheets
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Deleting Sheets

Jordan,

Try something like the following:

Dim WS As Worksheet
For Each WS In ThisWorkbook.Worksheets
Select Case WS.Name
Case "Control", "Menu", "Table"
Case Else
WS.Delete
End Select
Next WS

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Jordan" wrote in message
...
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?