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  
 
programming4us programming4us