Using Array to refer to multiple sheets

Vishesh's picture
The following example code deletes multiple sheets in one go.
Sub DeleteMultipleSheets()
    Application.DisplayAlerts = False
    With ThisWorkbook.Worksheets(Array("Sheet2", "Sheet3"))
        .Delete
    End With
    Application.DisplayAlerts = True
End Sub