Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() Hi I use this macro to protect and unprotect all the worksheets in my workbook : Protect_Unprotect Macro ' Shortcut Ctrl + z ' Protects / Unprotects by turn all sheets in a workbook ' Const PWORD As String = "12071956" Dim wkSht As Worksheet Dim statStr As String For Each wkSht In ActiveWorkbook.Worksheets With wkSht statStr = statStr & vbNewLine & "Sheet " & .Name If .ProtectContents Then wkSht.Unprotect Password:=PWORD statStr = statStr & ": Unprotected" Else wkSht.Protect Password:=PWORD statStr = statStr & ": Protected" End If End With Next wkSht MsgBox Mid(statStr, 2) ' End Sub it works very well , but unfortunately resets all the protection parameters to the minimum. I need to add a line to it so that it will maintain formatting of rows in the protected sheet. AllowFormattingRows:=True but I'm not sure where i can incorporate it into the code. Can someone help? Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Modification | Excel Worksheet Functions | |||
Macro Modification - Bob Philips Are You Out There ? | Excel Worksheet Functions | |||
Macro Modification | Excel Worksheet Functions | |||
Macro modification | Excel Discussion (Misc queries) | |||
Macro Modification Help | Excel Worksheet Functions |