Mention the sheets not to be deleted in the string variable comma separated
without any spaces.. and try the macro
strSheet = "Sheet1,Sheet2"
Sub Macro()
Dim strSheet As String
strSheet = "Sheet1,Sheet2"
For Each sh In Worksheets
If InStr(1, "," & strSheet & ",", "," & sh.Name & ",", _
vbTextCompare) = 0 Then sh.Delete
Next
End Sub
If this post helps click Yes