ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   prevent warning message from appearing (https://www.excelbanter.com/excel-programming/346498-prevent-warning-message-appearing.html)

Tijmen

prevent warning message from appearing
 
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



Nick Hodge

prevent warning message from appearing
 
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
HIS


"Tijmen" wrote in message
...
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





All times are GMT +1. The time now is 11:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com