Using Array to refer to multiple sheets

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
»
- Vishesh's blog
- Login or register to post comments
- 7953 reads
Recent comments
6 years 12 weeks ago
6 years 50 weeks ago
7 years 10 weeks ago
7 years 13 weeks ago
7 years 14 weeks ago
7 years 19 weeks ago
7 years 28 weeks ago
7 years 28 weeks ago
7 years 28 weeks ago
7 years 28 weeks ago