Question : get names of sheets

Is there a way to obtain the names of the worksheets in a workbook?

Answer : get names of sheets

So with the conditional name processing I gave above you could delete sheets in the first CAse statement ("Sheet1", "Fred") like this

The Case approach also lets you use wildcards for the sheet names

Cheers
Dave
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
Private Sub Workbook_Open()
    Dim ws As Worksheet
    Application.DisplayAlerts = False
    For Each ws In ThisWorkbook.Sheets
        Select Case ws.Name
        Case "Sheet1", "Fred"
            ws.Delete
        Case "Sheet2", "Freddy"
            'other stuff
        Case Else
            ' process any unmatched sheets
        End Select
    Next
        Application.DisplayAlerts = True
End Sub
Random Solutions  
  •  How do you import outlook express 6 messages into Windows Live Mail and have them in the proper folders?
  •  Cannot use remote executables after I upgraded to R2
  •  Mixed tooltips using AddTool (GetDlgItem (IDC_THIS), IDC_THIS) and AddTool (this, LPSTR_TEXTCALLBACK) how to.
  •  VPN client (Check point Secure client) not able to browse to any website on the machine once connected to the VPN.
  •  How do I remove special characters in a query?
  •  Purge Deleted items from database immediatly after message recall
  •  msaccess 2003 and turning on a new menu toolbar from module code and turning off the main menu from the same place
  •  Problem with Joomla email cloaking
  •  can i use right([ClientName] to get the last part of a string in a Microsoft Access query if i don't know how long the last part is?
  •  How can I print using a Clipper (DOS) application under Windows 7
  •  
    programming4us programming4us