Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() HI I use this code to protect / unprotect my worksheets. Sub Protect_Unprotect() ' ' 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 What I'd like to do is to add a line or two which qualifies the protect element so that it will allow for cell formatting once the sheet is protected. Can someone suggest a modification of the above ot allow for this? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Preserving formatting in a formula. | Excel Discussion (Misc queries) | |||
MS Query from Excel - Preserving formatting, validation and Commen | Excel Discussion (Misc queries) | |||
Preserving Cell References | Excel Discussion (Misc queries) | |||
preserving cell format | Excel Discussion (Misc queries) | |||
Preserving cell reference after a sort | New Users to Excel |