Unprotect sheets, how to?
Sorry, sorry, Dave
Everything is OK, wrong pasword
(this is faster way, but 30-times is neded pasword reenter to box)
"Dave Peterson" wrote in message
...
You could use a macro...
Option Explicit
Sub UnprotectAll()
Dim wks As Object
Dim wCtr As Long
For wCtr = 1 To 30
Set wks = Sheets("R" & wCtr)
With wks
If .ProtectContents = True _
Or .ProtectDrawingObjects = True _
Or .ProtectScenarios = True Then
On Error Resume Next
.Unprotect
If Err.Number < 0 Then
MsgBox "Something went wrong with: " & wks.Name
Err.Clear
'exit for 'stop trying???
End If
On Error GoTo 0
End If
End With
Next wCtr
End Sub
Sub ProtectAll()
Dim wks As Object
Dim wCtr As Long
For wCtr = 1 To 30
Set wks = Sheets("R" & wCtr)
With wks
If .ProtectContents = True _
Or .ProtectDrawingObjects = True _
Or .ProtectScenarios = True Then
'do nothing, it's already protected
Else
On Error Resume Next
.Protect
If Err.Number < 0 Then
MsgBox "Something went wrong with: " & wks.Name
Err.Clear
'exit for 'stop trying???
End If
On Error GoTo 0
End If
End With
Next wCtr
End Sub
fooreest wrote:
I have sheets named R1,R2,R3, ...... R30
All 30 are with same pasword protected
How to unprotect all 30 sheets at same time? One by one is so hard.
Thanks a lot.
--
Dave Peterson
|