Delete worksheet without confirmation

I

Ivan

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
 
T

Tom Ogilvy

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top