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
- 2769 reads
Recent comments
5 years 41 weeks ago
6 years 27 weeks ago
6 years 39 weeks ago
6 years 42 weeks ago
6 years 43 weeks ago
6 years 48 weeks ago
7 years 4 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago