ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete worksheet without confirmation (https://www.excelbanter.com/excel-programming/353114-delete-worksheet-without-confirmation.html)

ivan

Delete worksheet without confirmation
 
Dear all,

I am using a macro to delete a worksheet of a workbook:

Sheets("mySheet").Select
ActiveWindow.SelectedSheets.Delete

However, it prompts me a dialog box for confirmation everytime. How to skip
this so that the sheet can be delete right away??
Thanks.

Ivan

Tom Ogilvy

Delete worksheet without confirmation
 
application.DisplayAlerts = False
Sheets("MySheet").Delete
application.DisplayAlerts = True

--
Regards,
Tom Ogilvy

"Ivan" wrote in message
...
Dear all,

I am using a macro to delete a worksheet of a workbook:

Sheets("mySheet").Select
ActiveWindow.SelectedSheets.Delete

However, it prompts me a dialog box for confirmation everytime. How to

skip
this so that the sheet can be delete right away??
Thanks.

Ivan





All times are GMT +1. The time now is 09:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com