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
- 7633 reads
Recent comments
5 years 6 weeks ago
5 years 44 weeks ago
6 years 4 weeks ago
6 years 7 weeks ago
6 years 8 weeks ago
6 years 13 weeks ago
6 years 21 weeks ago
6 years 22 weeks ago
6 years 22 weeks ago
6 years 22 weeks ago