NicolaasH
Technical User
- Sep 11, 2007
- 38
Hi,
I am having some difficulty with unprotecting worksheets. I have a procedure that should unprotect all worksheets in the workbook (about 10 sheets), but sometimes not all worksheets are then unprotected, it either skips sheets, or stops at a certain sheet. I'm not sure what is different in the situation when it does not work from situations when it does work. The workbook is activated when the procedure runs.
Does anybody have any clue how to solve this?
Thanks for your help!
Nick
I am having some difficulty with unprotecting worksheets. I have a procedure that should unprotect all worksheets in the workbook (about 10 sheets), but sometimes not all worksheets are then unprotected, it either skips sheets, or stops at a certain sheet. I'm not sure what is different in the situation when it does not work from situations when it does work. The workbook is activated when the procedure runs.
Code:
Sub ProtectionOff()
For Each WS In ThisWorkbook.Worksheets
WS.Unprotect Password:="Pass"
Next WS
End Sub
Does anybody have any clue how to solve this?
Thanks for your help!
Nick