ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Force Delete a Sheet (https://www.excelbanter.com/excel-programming/286877-force-delete-sheet.html)

Michael Kintner

Force Delete a Sheet
 
How can I force Delete a Sheet without having a popup dialog?

I am currently doing this (ActiveWindow.SelectedSheets.Delete)

Is there anyother way?

Thank you in advance for your help...

Mike



Chip Pearson

Force Delete a Sheet
 
Michael,

Use something like

Application.DisplayAlerts = False
' delete the sheet
Application.DisplayAlerts = True


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


"Michael Kintner" wrote in message
...
How can I force Delete a Sheet without having a popup dialog?

I am currently doing this (ActiveWindow.SelectedSheets.Delete)

Is there anyother way?

Thank you in advance for your help...

Mike





Ron de Bruin

Force Delete a Sheet
 
Sub test()
Application.DisplayAlerts = False
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True
End Sub

Use Application.DisplayAlerts Michael

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Michael Kintner" wrote in message ...
How can I force Delete a Sheet without having a popup dialog?

I am currently doing this (ActiveWindow.SelectedSheets.Delete)

Is there anyother way?

Thank you in advance for your help...

Mike





Paul B[_7_]

Force Delete a Sheet
 
Mike, try this

Sub test()
Application.DisplayAlerts = False
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True

End Sub

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 97 & 2000
** remove news from my email address to reply by email **

"Michael Kintner" wrote in message
...
How can I force Delete a Sheet without having a popup dialog?

I am currently doing this (ActiveWindow.SelectedSheets.Delete)

Is there anyother way?

Thank you in advance for your help...

Mike





Jake Marx[_3_]

Force Delete a Sheet
 
Hi Michael,

To supress the messagebox(es), you can use the DisplayAlerts property:

Application.DisplayAlerts=False
'/ delete sheet here
Application.DisplayAlerts=True

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

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


Michael Kintner wrote:
How can I force Delete a Sheet without having a popup dialog?

I am currently doing this (ActiveWindow.SelectedSheets.Delete)

Is there anyother way?

Thank you in advance for your help...

Mike



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

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