ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   deleting sheet: how to omit warning (https://www.excelbanter.com/excel-programming/284862-deleting-sheet-how-omit-warning.html)

Marco Braun

deleting sheet: how to omit warning
 
Hello there,

when I call sheets(xyz).delete to delete a sheet from a workbook I
get a warning at runtime asking if I am sure that I want that sheet
deleted. (I wouldn't have coded it that way if I didn't want it deleted :-))
My question: How do I omit this warning at runtime of my vba script?

thanks
Marco


patrick molloy

deleting sheet: how to omit warning
 
Application.DisplayAlerts = False

....will turn off such warnings

Patrick Molloy
Microsoft Excel MVP
-----Original Message-----
Hello there,

when I call sheets(xyz).delete to delete a sheet from a

workbook I
get a warning at runtime asking if I am sure that I want

that sheet
deleted. (I wouldn't have coded it that way if I didn't

want it deleted :-))
My question: How do I omit this warning at runtime of my

vba script?

thanks
Marco

.


Jim Rech

deleting sheet: how to omit warning
 
Use Application.DisplayAlerts = False

This will block all alerts until the macro ends so you may want to set it to
True after the delete.

--
Jim Rech
Excel MVP



No Name

deleting sheet: how to omit warning
 
Don't forget to turn it back on again at the end!
-----Original Message-----
Application.DisplayAlerts = False

....will turn off such warnings

Patrick Molloy
Microsoft Excel MVP
-----Original Message-----
Hello there,

when I call sheets(xyz).delete to delete a sheet from a

workbook I
get a warning at runtime asking if I am sure that I want

that sheet
deleted. (I wouldn't have coded it that way if I didn't

want it deleted :-))
My question: How do I omit this warning at runtime of my

vba script?

thanks
Marco

.

.


david mcritchie

deleting sheet: how to omit warning
 
You might find the following example of some interest, I use it to
delete sheets that look like I have no further use for, but it will not
delete sheets that have event macros, which may have something
still of interest.

Delete Active Sheet if name begins with "sheet" (#DeleteThisSheet)
http://www.mvps.org/dmcritchie/excel...eleteThisSheet

Information on event macros on my event.htm page.

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

wrote in message ...
Don't forget to turn it back on again at the end!
-----Original Message-----
Application.DisplayAlerts = False

....will turn off such warnings

Patrick Molloy
Microsoft Excel MVP
-----Original Message-----
Hello there,

when I call sheets(xyz).delete to delete a sheet from a

workbook I
get a warning at runtime asking if I am sure that I want

that sheet
deleted. (I wouldn't have coded it that way if I didn't

want it deleted :-))
My question: How do I omit this warning at runtime of my

vba script?

thanks
Marco

.

.





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

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