VBA to sidestep popups...

C

Colin Hayes

Hi All

As part of a macro , I use this command :

ActiveWindow.SelectedSheets.Delete

On each occasion I run it , I get a popup which ask me if I really want
to delete the relevant sheet. This brings the whole macro to a halt.

Is there a command I can use to avoid the popup , and have the macro
perform the deletion without stopping the whole routine?

Grateful for any help.



Best Wishes
 
D

Dave Peterson

Application.displayalerts = false
'your code here
application.displayalerts = true
 
R

Rick Rothstein

Try it this way...

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

Jim Thomlinson

application.dispayalerts = false
ActiveWindow.SelectedSheets.Delete
application.displayalerts = true
 
C

Colin Hayes

Rick Rothstein said:
Try it this way...

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


Hi All

OK Thanks for the suggestions - that's fixed it. No more popup.

Thanks.
 

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