Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Below is a free macro widely available on numerous sites to delete hidden
sheets in a workbook: Sub Delete_Hidden_Sheets() ' Remove hidden sheets from your document i = 1 While i <= Worksheets.Count If Not Worksheets(i).Visible Then Worksheets(i).Delete Else i = i + 1 End If Wend End Sub Problem I'm having is that it works fine if I delete sheets, but if I decide to cancel using the "Cancel" button from the warning message, it goes to the "End If" then "Wend" then cycles again coming back to the warning message again. Only way to break free is kill the macro by ctrl-break, then end. Any ideas on how to cancel and have it stop the macro? Thanks -- Lee |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
"With Sheets" Issue - macro on one sheet to affect hidden rows on other sheets | 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 | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming |