prevent warning message from appearing

T

Tijmen

I want to remove a sheet

Sheets(2).Delete

Excel then comes up with a warning: "The selected sheet(s) will be
permananently deleted. To delete the selected sheets, click OK.To cancel the
deletion, click Cancel"

Can I somehow catch this message end prevent it from appearing?

Thanks,

Tijmen
 
N

Nick Hodge

Tijmen

Application.DisplayAlerts = False

Set to True at end of code or any error code that may exit the code
prematurely

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
(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