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
- 2737 reads
Recent comments
5 years 36 weeks ago
6 years 22 weeks ago
6 years 34 weeks ago
6 years 37 weeks ago
6 years 38 weeks ago
6 years 43 weeks ago
6 years 52 weeks ago
7 years 2 days ago
7 years 3 days ago
7 years 3 days ago