remove Worksheet using Sh.Delete without prompt

G

Guest

Can I remove a worksheet using a VBA function:
For example:

Sheet1.Delete

WITHOUT PROMPTING the user with this message:
"Data may exist in the sheet(s) selected for deletion. to permanently delete
the data, press Delete. "

Thanks

Coco
ps. I know that this Sheet1 has data. Moreover, it is not important in this
case.
 
J

Jake Marx

Hi Coco,
Can I remove a worksheet using a VBA function:
For example:

Sheet1.Delete

WITHOUT PROMPTING the user with this message:
"Data may exist in the sheet(s) selected for deletion. to permanently
delete the data, press Delete. "

You can use the DisplayAlerts property:

Application.DisplayAlerts=False
Sheet1.Delete
Application.DisplayAlerts=True

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]
 
J

JE McGimpsey

One way:

Application.DisplayAlerts = False
Sheet1.Delete
Application.DisplayAlerts = True
 

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