Hi,
If I have about 50 tabs in a workbook but I want to delete 45 of them and only keep 5, I don't want to do this:
...
For each s in Worksheets
Select Case s.Name
Case "tab1","tab2",..."tab40","tab42"
s.Delete
Case Else
End Select
Next
...
As I tried the following, it won't work:
...
Select Case s.Name
Case Not ("tab45","tab46","tab47","tab49","tab50")
s.Delete
Case Else
End Select
...
BTW, the tabs are not attached with a sequential number as I listed, which is just for explanation.
Thanks in advance.
If I have about 50 tabs in a workbook but I want to delete 45 of them and only keep 5, I don't want to do this:
...
For each s in Worksheets
Select Case s.Name
Case "tab1","tab2",..."tab40","tab42"
s.Delete
Case Else
End Select
Next
...
As I tried the following, it won't work:
...
Select Case s.Name
Case Not ("tab45","tab46","tab47","tab49","tab50")
s.Delete
Case Else
End Select
...
BTW, the tabs are not attached with a sequential number as I listed, which is just for explanation.
Thanks in advance.