close

I have a booklet with about 20 sheets. I would like to unprotect and protect
the sheets together, not one at a time. Protecting the workbook doesn't
protect the cells.

Is there such a function?Thanks
Mark
Hi
This will work and a password is not required

Macro for protecting and unprotecting worksheets.
NOT USING A PASSWORD.

Sub SheetLock()
'
' SheetLock Macro
Application.ScreenUpdating = False
Dim ws As Worksheet
For Each ws In Worksheets
ws.Protect
Next ws
Application.ScreenUpdating = True
End SubSub SheetUnLock()
'
' SheetUnLock Macro
Application.ScreenUpdating = False
Dim ws As Worksheet
For Each ws In Worksheets
ws.Unprotect
Next ws
Application.ScreenUpdating = True
End Sub

HTH
Michael M

quot;MWBquot; wrote:

gt; I have a booklet with about 20 sheets. I would like to unprotect and protect
gt; the sheets together, not one at a time. Protecting the workbook doesn't
gt; protect the cells.
gt;
gt; Is there such a function?
gt;
gt;
gt; Thanks
gt; Mark
gt;
gt;
gt;

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

    software

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