VBA for deleting a sheet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using the following code to delete a sheet within Excel:

ActiveWindow.SelectedSheets.Delete

Problem is, it is prompting the user to see if it is okay to delete. In
every scenario of this macro, it will be okay to delete, so how can I bypass
this message?
 
Hi Mike,

Try:

Application.DisplayAlerts = False
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True
 
Hello Mike,

Application.DisplayAlerts = False
ActiveWindow.SelectedSheets.Delete
Application.DispalyAlerts = True

Sincerely,
Leith Ross
 

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

Back
Top