Nick,
Here is code that will do what you want. I've been playing with it and it works like a charm. If there are no passwords, then just leave the first inputbox blank, and enter a password in the second one to protect all the sheets. If you want them all unprotected leave the second inputbox blank. Let me know how it works.
Ryan
Sub ChangePassword()
Dim Sheet As Worksheet
Dim OldPass As Variant
Dim NewPass As Variant
Application.ScreenUpdating = False
OldPass = InputBox("Please enter old password", "Old Password")
'If OldPass = "" Then Exit Sub
NewPass = InputBox("Please enter new password", "New Password")
If MsgBox("This will replace your old password with a new one", vbOKCancel, "Continue") _
= vbCancel Then Exit Sub
For Each Sheet In Worksheets
On Error Resume Next
Sheet.Unprotect Password:=OldPass
If NewPass <> "" Then Sheet.Protect Password:=NewPass
Next Sheet
Application.ScreenUpdating = True
End Sub
The line where it says:
'If OldPass = "" Then Exit Sub
You can delete. Sorry about that, i forgot to take it out.
Re: enter the new password TWICE
You ought to force the user to enter the new password twice, and check they're the same before you protect all the sheets
Just in case they didn't hit the keys they intended (or thought the entered)