Delete All Worksheets Apart From Some With Particular Name

D

Dave

How would I delete all Worksheets in a Workbook except those called "HOME",
"ONE" and "TWO" (for example).

Thanks!
Dave
 
J

JP

Sub DeleteSheets()
Dim sht As Worksheet
Application.ScreenUpdating = False

For Each sht In Worksheets
If sht.Name <> "HOME" Then
If sht.Name <> "ONE" Then
If sht.Name <> "TWO" Then
Application.DisplayAlerts = False
sht.Delete
Application.DisplayAlerts = True
End If
End If
End If
Next sht

Application.ScreenUpdating = True
End Sub
 
Top