Deleting Excel Worksheets with macro

5 pts.
Tags:
Excel workbooks
Excel worksheets
Microsoft Excel
Microsoft Excel 2000
Microsoft Excel macros
I am using excel 2000 and have workbook that uses macro to delete several worksheets and then save the workbook under a name in one of the cells. All works fine but for each worksheet a quiery pops up to ask if you want to delet this sheet. How do I delete sheets in the macro without having this pop up window?

Answer Wiki

Thanks. We'll let you know when a new response is added.

Look under macro … there will be MsgBox command. (this is the message that pops up)
Try commenting out the MsgBox command.
You then also need to adjust accordingly the corresponding Event/Cancel response to the pop up.

I have Excel 2007 (but Excel 2000 should work similarly)

Hi
How about adding …
Application.DisplayAlerts = False
Your code
Application.DisplayAlerts = True

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following