Macro to lock all worksheets


Posted by Paul on December 20, 2000 6:47 PM

Are there any macros that will lock an unlock all the sheets in a workbook at one time? I want the user to have to put in a password when the button to unlock the sheets is pushed. Thanks for your help.



Posted by cpod on December 21, 2000 8:42 AM

Dim WS
For Each WS In Worksheets
WS.Protect "password"
Next


Dim WS
For Each WS In Worksheets
WS.Unprotect "password"
Next