MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Macro dialogue/message boxes answering

Posted by Murray Couper on December 11, 2001 4:59 PM

I have a macro that deletes worksheets
i.e. ActiveWindow.SelectedSheets.Delete

How do I put in the macro to confirm this deletion when the message box appears after this operation ?

Also, the same question basically for subtotalling.
I want to say in the macro the 'OK' box that is in the message about header data.

Posted by Jacob on December 11, 2001 5:44 PM

If you just want to bypass the "do you want to delete this" dialog just put this at the beginning of your code


this way the message box wont be shown and the sheet will just be deleted.

To add a header to the message box it is just one of the string variables like msgbox("message","header",more stuff etc)

Hope this helps