ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Unprotect Sheets (https://www.excelbanter.com/excel-worksheet-functions/6810-unprotect-sheets.html)

Karen

Unprotect Sheets
 
Is there a way to unprotect a series of worksheets?
All of the worksheets have the same password.
When I group the worksheets and go to Tools Protection,
the "Unprotect Sheet" opeion is grayed out.

Thank you

Frank Kabel

Hi
not possible without VBA

--
Regards
Frank Kabel
Frankfurt, Germany

"Karen" schrieb im Newsbeitrag
...
Is there a way to unprotect a series of worksheets?
All of the worksheets have the same password.
When I group the worksheets and go to Tools Protection,
the "Unprotect Sheet" opeion is grayed out.

Thank you



Karen

Does anyone have any VBA code to unprotect a series of
worksheets?
Thank you

-----Original Message-----
Hi
not possible without VBA

--
Regards
Frank Kabel
Frankfurt, Germany

"Karen" schrieb im

Newsbeitrag
...
Is there a way to unprotect a series of worksheets?
All of the worksheets have the same password.
When I group the worksheets and go to Tools

Protection,
the "Unprotect Sheet" opeion is grayed out.

Thank you


.


Adam

Hi Karen,
I had the very same problem some time back and got an excellent VBA code
from Harald staff that you can find below. You have one sub that protects all
the worksheets with the same password and one that unlocks all the sheets
with the same PW.

-------------------
Hi

Not without macro code. Here it is:

Sub LockEm()
Dim i As Long
Dim PW As String
Dim WS As Worksheet
PW = InputBox("Password:")
On Error GoTo MyErr
For Each WS In ActiveWorkbook.Worksheets
WS.Protect (PW)
Next
MsgBox i & " errors while protecting", vbInformation
Exit Sub
MyErr:
i = i + 1
Resume Next
End Sub

Sub UnLockEm()
Dim i As Long
Dim PW As String
Dim WS As Worksheet
PW = InputBox("Password:")
On Error GoTo MyErr
For Each WS In ActiveWorkbook.Worksheets
WS.Unprotect (PW)
Next
MsgBox i & " errors while unprotecting", vbInformation
Exit Sub
MyErr:
i = i + 1
Resume Next
End Sub


"Karen" skrev:

Thank you - I'll give it a try
-----Original Message-----
Hi
try

sub unprotect_all()
dim wks as worksheet
on error resume next
for each wks in activeworkbook.worksheets
wks.unprotect
next
end sub

If you have a password applied change
wks.unprotect
to
wks.unprotect password:="your password"

--
Regards
Frank Kabel
Frankfurt, Germany

"Karen" schrieb im

Newsbeitrag
...
Does anyone have any VBA code to unprotect a series of
worksheets?
Thank you

-----Original Message-----
Hi
not possible without VBA

--
Regards
Frank Kabel
Frankfurt, Germany

"Karen" schrieb

im
Newsbeitrag
...
Is there a way to unprotect a series of worksheets?
All of the worksheets have the same password.
When I group the worksheets and go to Tools
Protection,
the "Unprotect Sheet" opeion is grayed out.

Thank you

.


.




All times are GMT +1. The time now is 01:29 AM.

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