Try this:
Sub Protect_sheets()
Dim wSheet As Worksheet
Dim Pwd As String
Pwd = InputBox("Enter your password to protect all worksheets", "Password Input")
For Each wSheet In Worksheets
With wSheet
.Protect Password:=Pwd
.EnableSelection = xlNoSelection
End With
Next wSheet
End Sub
Sub UnProtect_sheets()
Dim wSheet As Worksheet
Dim Pwd As String
Pwd = InputBox("Enter your password to unprotect all worksheets", "Password Input")
For Each wSheet In Worksheets
wSheet.Unprotect Password:=Pwd
Next wSheet
End Sub
Bookmarks