XLA Routines: EE_DeleteSheets

Following on from EE_DeleteSheet, here's a routine that deletes multiple sheets
Sub EE_DeleteSheets(ArrayOrRange) Dim blnDisplayAlerts As Boolean Dim arr Dim wbk As Workbook 'http://excelexperts.com/xla-routines-eedeletesheets Set wbk = ActiveWorkbook Select Case TypeName(ArrayOrRange) Case "Variant()", "String" arr = ArrayOrRange Case "Range" arr = Application.Transpose(ArrayOrRange.SpecialCells(xlCellTypeConstants)) Case Else End Select blnDisplayAlerts = Application.DisplayAlerts Application.DisplayAlerts = False On Error Resume Next wbk.Worksheets(arr).Delete Err.Clear: On Error GoTo 0: On Error GoTo -1 Application.DisplayAlerts = blnDisplayAlerts Set wbk = Nothing End Sub
»
- Nick's blog
- Login or register to post comments
- 2901 reads
Recent comments
6 years 4 weeks ago
6 years 42 weeks ago
7 years 2 weeks ago
7 years 4 weeks ago
7 years 5 weeks ago
7 years 11 weeks ago
7 years 19 weeks ago
7 years 19 weeks ago
7 years 20 weeks ago
7 years 20 weeks ago