prevent message

  • Thread starter Thread starter Jack Sons
  • Start date Start date
J

Jack Sons

Hi all,

I have some code that deletes trhee sheets of my workbook. When executed the
code stops and I get a message warning me that the sheets can not be
recovered and asking me if I want to go on with the execution of the code.
After clicking the OK button on the message the execution goes on.

What code do I need to either prevent the message or to say OK to it?

TIA

Jack Sons
The Netherlands
 
Hi

Application.DisplayAlerts = False
Sheets("MySheet").Delete
Application.DisplayAlerts = True ' Always set it True again

Hopes this helps.
 
Per,

Works fine, thank you.

Jack.

Per Jessen said:
Hi

Application.DisplayAlerts = False
Sheets("MySheet").Delete
Application.DisplayAlerts = True ' Always set it True again

Hopes this helps.
 

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

Back
Top