ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deleting sheets without confirmation (https://www.excelbanter.com/excel-programming/333428-deleting-sheets-without-confirmation.html)

PCLIVE

Deleting sheets without confirmation
 
I'm using the following code:

Sheets("Setup").delete


What do I need to add to this to prevent the confirmation message from
appearing? I would like the sheet to be deleted without any interaction.

Thanks,
Paul



Tom Ogilvy

Deleting sheets without confirmation
 
Application.DisplayAlerts = False
Sheets("Setup").delete
Application.DisplayAlerts = True

--
Regards,
Tom Ogilvy


"PCLIVE" wrote in message
...
I'm using the following code:

Sheets("Setup").delete


What do I need to add to this to prevent the confirmation message from
appearing? I would like the sheet to be deleted without any interaction.

Thanks,
Paul





Chip Pearson

Deleting sheets without confirmation
 
Use Application.DisplayAlerts = False to suppress the
confirmation message. E.g.,

Application.DisplayAlerts = False
Sheets("Setup").Delete
Application.DisplayAlerts = True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"PCLIVE" wrote in message
...
I'm using the following code:

Sheets("Setup").delete


What do I need to add to this to prevent the confirmation
message from appearing? I would like the sheet to be deleted
without any interaction.

Thanks,
Paul




PCLIVE

Deleting sheets without confirmation
 
Thanks Tom.
Much appreciated.


"Tom Ogilvy" wrote in message
...
Application.DisplayAlerts = False
Sheets("Setup").delete
Application.DisplayAlerts = True

--
Regards,
Tom Ogilvy


"PCLIVE" wrote in message
...
I'm using the following code:

Sheets("Setup").delete


What do I need to add to this to prevent the confirmation message from
appearing? I would like the sheet to be deleted without any interaction.

Thanks,
Paul







PCLIVE

Deleting sheets without confirmation
 
Thanks Chip.
Most helpful. Also, great website. Thanks again.

Paul

"Chip Pearson" wrote in message
...
Use Application.DisplayAlerts = False to suppress the confirmation
message. E.g.,

Application.DisplayAlerts = False
Sheets("Setup").Delete
Application.DisplayAlerts = True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"PCLIVE" wrote in message
...
I'm using the following code:

Sheets("Setup").delete


What do I need to add to this to prevent the confirmation message from
appearing? I would like the sheet to be deleted without any interaction.

Thanks,
Paul







All times are GMT +1. The time now is 10:02 PM.

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