Delete sheets without confirmation prompts

 1999-12-20    Workbooks    0    225

If you want to delete sheets from a workbook without the user being prompted for any confirmations you can use this macro:

Sub DeleteSheet(strSheetName As String)
' deletes a sheet named strSheetName in the active workbook
    Application.DisplayAlerts = False
    Sheets(strSheetName).Delete
    Application.DisplayAlerts = True
End Sub