Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bypass warning when deleting a tab in Excel 2

Status
Not open for further replies.

mal2ty

Technical User
Jun 25, 2001
28
US
I'm using VBA to delete a worksheet in Excel. Each time I delete a worksheet, Excel produces a message box with the following warning:

The selected sheet(s) will be permanently deleted.
To delete the selected sheets, click OK.
To cancel the deletion, click Cancel.

Is there a way to bypass this warning using VBA? The code I'm currently using is as follows:

Sheets("Summary").Select
ActiveWindow.SelectedSheets.Delete
 
Yes, there is.

Application.DisplayAlerts = False

Don't forget to turn it back on when you are done, unless you want it to stay off.
 
That's exactly what I was looking for. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top