prevent message

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
 
P

Per Jessen

Hi

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

Hopes this helps.
 
J

Jack Sons

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.
 
Top