close

What code do I need in a macro to determine whether a sheet is protected or
not?

John, here is one way,

Sub Check__Sheet_Protection()
Dim wks As Worksheet
Set wks = ActiveSheet
With wks
If .ProtectContents _
Or .ProtectDrawingObjects _
Or .ProtectScenarios Then
MsgBox quot;Protected sheetquot;
Exit Sub
Else
MsgBox quot;Unprotected Sheetquot;
End If
End With
End Sub--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 amp; 2003

quot;Johnquot; gt; wrote in message
...
gt; What code do I need in a macro to determine whether a sheet is protected
gt; or
gt; not?

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()