How to write a marco in Excel to delete worksheet?

K

ko06879

Dear Friends,

Do you know how to write a marco in Excel to delete worksheet
automatically, without prompting me to click OK?

I have tried one by using the command:
Sheets("Sheet2").Delete

but it will ask me to click OK before delete it. It looks not
professional.

Thanks a lot.
 
P

papou

Hello
Application.DisplayAlerts = False
Sheets("Sheet2").Delete
Application.DisplayAlerts = True

HTH
Cordially
Pascal

"ko06879" <[email protected]> a écrit
dans le message de (e-mail address removed)...
 

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