Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
WorkSheet.Delete
I've run into a problem about deleting sheets. I wrote
a "work around" whereby the unwanted sheet is moved to a new workbook and the new workbook is closed without saving it, but I just think there has to be a better way! If I use VB to delete a worksheet, I do not know how to prevent the system from asking to confirm delete. This same message appears when you manually delete, by the way. Does anyone know how to answer (or prevent from showing) that message box using VB? Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
WorkSheet.Delete
Hi Pokey
Try this Sub test() Application.DisplayAlerts = False ActiveSheet.Delete Application.DisplayAlerts = True End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Pokey*" wrote in message ... I've run into a problem about deleting sheets. I wrote a "work around" whereby the unwanted sheet is moved to a new workbook and the new workbook is closed without saving it, but I just think there has to be a better way! If I use VB to delete a worksheet, I do not know how to prevent the system from asking to confirm delete. This same message appears when you manually delete, by the way. Does anyone know how to answer (or prevent from showing) that message box using VB? Thanks! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
WorkSheet.Delete
Use Application.DisplayAlerts = False to prevent the message box.
E.g., Application.DisplayAlerts = False ' delete the sheet Application.DisplayAlerts = True -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Pokey*" wrote in message ... I've run into a problem about deleting sheets. I wrote a "work around" whereby the unwanted sheet is moved to a new workbook and the new workbook is closed without saving it, but I just think there has to be a better way! If I use VB to delete a worksheet, I do not know how to prevent the system from asking to confirm delete. This same message appears when you manually delete, by the way. Does anyone know how to answer (or prevent from showing) that message box using VB? Thanks! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
WorkSheet.Delete
AWWESOME, THANKS!!!
-----Original Message----- Hi Pokey Try this Sub test() Application.DisplayAlerts = False ActiveSheet.Delete Application.DisplayAlerts = True End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Pokey*" wrote in message ... I've run into a problem about deleting sheets. I wrote a "work around" whereby the unwanted sheet is moved to a new workbook and the new workbook is closed without saving it, but I just think there has to be a better way! If I use VB to delete a worksheet, I do not know how to prevent the system from asking to confirm delete. This same message appears when you manually delete, by the way. Does anyone know how to answer (or prevent from showing) that message box using VB? Thanks! . |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
WorkSheet.Delete
AWWESOME, THANKS!!!
-----Original Message----- Use Application.DisplayAlerts = False to prevent the message box. E.g., Application.DisplayAlerts = False ' delete the sheet Application.DisplayAlerts = True -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Pokey*" wrote in message ... I've run into a problem about deleting sheets. I wrote a "work around" whereby the unwanted sheet is moved to a new workbook and the new workbook is closed without saving it, but I just think there has to be a better way! If I use VB to delete a worksheet, I do not know how to prevent the system from asking to confirm delete. This same message appears when you manually delete, by the way. Does anyone know how to answer (or prevent from showing) that message box using VB? Thanks! . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
delete value on worksheet 2 that match values on worksheet 1 | Excel Discussion (Misc queries) | |||
delete a worksheet | Excel Discussion (Misc queries) | |||
How to delete a duplicate Excel worksheet within that worksheet? | Excel Discussion (Misc queries) | |||
Delete worksheet | Excel Discussion (Misc queries) | |||
when i delete a row in one worksheet, how do i... | Excel Worksheet Functions |