This code will protect all of your worksheets. Since the password is hard-coded, you'll also want to password-protect the module that the code is on. Otherwise you can have the code prompt the user for a password with an InputBox statement.
Private Sub ProtectAll()
For i = 1 To Sheets.Count
Sheets(i).Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="sample"
Next i
End Sub
This code will unprotect all worksheets. It will only work if all worksheets have the same password.
Private Sub UnprotectAll()
pw = InputBox("Enter Password", "Password")
For i = 1 To Sheets.Count
On Error GoTo Handler
Sheets(i).Unprotect Password:=pw
Next i
Exit Sub
Handler:
x = MsgBox("Incorrect Password", vbOKOnly, "Error")
Exit Sub
End Sub
-Ben
Ben... Thanks! That was enough info for me to put something together!