Delete sheets without confirmation prompts

 1999-12-20    Workbooks    0    49

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


Leave a comment:

Your comment will only be published after it has been moderated and found spam free.
Your e-mail address will only be used to display your Gravatar.