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

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



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

Thank you!!!!!!