ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Excel Booklet Protection Question (https://www.excelbanter.com/excel-worksheet-functions/86710-excel-booklet-protection-question.html)

MWB

Excel Booklet Protection Question
 
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



Michael M

Excel Booklet Protection Question
 
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 Sub


Sub 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

"MWB" wrote:

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





All times are GMT +1. The time now is 10:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com