Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I attempted to edit a macro from you folks to protect all sheets, because I
noticed that, if I hid some sheets, then the macro crashed. I added two rows, the if statement and the rem statement. This is still crashing with a worksheet hidden. I guess it may be that it can't select a sheet if it is hidden, so that my if statement is too late, or else my syntax is wrong! Kindly help. Thanks! Dean Sub ProtectAllWorksheets() Dim wks As Worksheet For Each wks In Worksheets If ActiveSheet.Hidden = True Then GoTo L1 wks.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _ , AllowFormattingCells:=True, AllowFormattingColumns:=True, _ AllowFormattingRows:=True L1: Rem Next wks End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hide or protect hidden rows/columns - macro help | Excel Programming | |||
Protect hidden rows/columns -macro help | Excel Discussion (Misc queries) | |||
How do I password protect hidden sheet? | Excel Discussion (Misc queries) | |||
"With Sheets" Issue - macro on one sheet to affect hidden rows on other sheets | Excel Programming | |||
Protect Sheet > All sheets | Excel Discussion (Misc queries) |