Archive of Mr Excel Message Board


Back to Excel VBA archive index
Back to archive home



Use macro to delete worksheet without getting confirm message?

Posted by Carol on October 24, 2001 9:13 AM
I've created a macro that transfers a lot of information from one worksheet to another. When it is complete, I need to delete the original worksheet. When I use the following code, excel puts up a message box asking for confirmation on the delete. Is there any way to get rid of that message box? I don't want the end user to see it.

Here's the code I'm using:
Sheets("MP-MT (2)").Select
ActiveWindow.SelectedSheets.Delete


Check out our Excel VBA Resources

Re: Use macro to delete worksheet without getting confirm message?

Posted by EDDIE G on October 24, 2001 9:20 AM


ADD TO YOUR CODE

APPLICATION.DISPLAYALERTS=FALSE
Sheets("MP-MT (2)").Select
ActiveWindow.SelectedSheets.Delete
APPLICATION.DISPLAYALERTS=TRUE


Thank you!!!!!!

Posted by Carol on October 24, 2001 9:21 AM



This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.