Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Greetings All,
How can I delete multiple sheets in VBA without having to acknowledge the Excel warning message for each sheet? I wrote a VBA routine that would loop through and delete all but the first sheet. But I have to acknowledge the warning message for each shett. Is there a way to select a range of sheets for deletion and only have to acknowledge the deletion once OR can I supress the warning message? Thanks in advance!!! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Not sure exactly what you rcode looks like but this will work...
Sub DeleteSheets dim wks as worksheet on error goto Errorhandler application.displayalerts = false for each wks in worksheets if wks.name < "Main" then wks.delete next wks Errorhandler: application.displayalerts = true end sub -- HTH... Jim Thomlinson "kurt" wrote: Greetings All, How can I delete multiple sheets in VBA without having to acknowledge the Excel warning message for each sheet? I wrote a VBA routine that would loop through and delete all but the first sheet. But I have to acknowledge the warning message for each shett. Is there a way to select a range of sheets for deletion and only have to acknowledge the deletion once OR can I supress the warning message? Thanks in advance!!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete rows in multiple sheets without loop? | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Delete Rows from multiple Sheets. | Excel Programming |