P
Paul Sheppard
Macros for Protect/Unprotect all sheets in a workbook
--------------------------------------------------------------------------------
I have been using the macros below for Protecting/Unprotecting al
sheets in a workbook, they work ok unless the sheets are passwor
protected, in which case the Unprotect drop down appears and I have t
enter the password for each sheet
Is there any way to change the macros so that irrespective of how man
sheets there are I only have to enter the password once to eithe
unprotect them all or protect them all
If possible the macro should still run for sheets with no password
Sub unprotect_all()
Dim wks As Worksheet
On Error Resume Next
For Each wks In ActiveWorkbook.Worksheets
wks.Unprotect
Next
End Sub
Sub protect_all()
Dim wks As Worksheet
On Error Resume Next
For Each wks In ActiveWorkbook.Worksheets
wks.Protect
Next
End Su
--------------------------------------------------------------------------------
I have been using the macros below for Protecting/Unprotecting al
sheets in a workbook, they work ok unless the sheets are passwor
protected, in which case the Unprotect drop down appears and I have t
enter the password for each sheet
Is there any way to change the macros so that irrespective of how man
sheets there are I only have to enter the password once to eithe
unprotect them all or protect them all
If possible the macro should still run for sheets with no password
Sub unprotect_all()
Dim wks As Worksheet
On Error Resume Next
For Each wks In ActiveWorkbook.Worksheets
wks.Unprotect
Next
End Sub
Sub protect_all()
Dim wks As Worksheet
On Error Resume Next
For Each wks In ActiveWorkbook.Worksheets
wks.Protect
Next
End Su