ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   remove Worksheet using Sh.Delete without prompt (https://www.excelbanter.com/excel-programming/332469-remove-worksheet-using-sh-delete-without-prompt.html)

Coco

remove Worksheet using Sh.Delete without prompt
 
Can I remove a worksheet using a VBA function:
For example:

Sheet1.Delete

WITHOUT PROMPTING the user with this message:
"Data may exist in the sheet(s) selected for deletion. to permanently delete
the data, press Delete. "

Thanks

Coco
ps. I know that this Sheet1 has data. Moreover, it is not important in this
case.


Jake Marx[_3_]

remove Worksheet using Sh.Delete without prompt
 
Hi Coco,

coco wrote:
Can I remove a worksheet using a VBA function:
For example:

Sheet1.Delete

WITHOUT PROMPTING the user with this message:
"Data may exist in the sheet(s) selected for deletion. to permanently
delete the data, press Delete. "


You can use the DisplayAlerts property:

Application.DisplayAlerts=False
Sheet1.Delete
Application.DisplayAlerts=True

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]

JE McGimpsey

remove Worksheet using Sh.Delete without prompt
 
One way:

Application.DisplayAlerts = False
Sheet1.Delete
Application.DisplayAlerts = True


In article ,
"coco" wrote:

Can I remove a worksheet using a VBA function:
For example:

Sheet1.Delete

WITHOUT PROMPTING the user with this message:
"Data may exist in the sheet(s) selected for deletion. to permanently delete
the data, press Delete. "

Thanks

Coco
ps. I know that this Sheet1 has data. Moreover, it is not important in this
case.


Coco

remove Worksheet using Sh.Delete without prompt
 
It works!!!

Thanks you
Coco


"JE McGimpsey" wrote:

One way:

Application.DisplayAlerts = False
Sheet1.Delete
Application.DisplayAlerts = True


In article ,
"coco" wrote:

Can I remove a worksheet using a VBA function:
For example:

Sheet1.Delete

WITHOUT PROMPTING the user with this message:
"Data may exist in the sheet(s) selected for deletion. to permanently delete
the data, press Delete. "

Thanks

Coco
ps. I know that this Sheet1 has data. Moreover, it is not important in this
case.




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

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