Hi Matt
What you propose is entirely possible.
I would set up a named range in your worksheet for the password. This means that if you move it around (insert/delete rows, etc) you won't have to change the macro.
In the following example, I've created a named range called "Passw" on Sheet1. Change the code in your example to:-
If objSheet.ProtectContents = False Then
objSheet.Protect Password:=sheets("Sheet1").range("Passw").Value
Else
objSheet.Unprotect Password:=Sheets("Sheet1").Range("Passw").Value
End If
There are some other options you might want to implement, such as
[code]
objSheet.Protect Password:=Sheets("Sheet1").Range("Passw").Value, AllowFiltering:=True, AllowUsingPivotTables:=True
[code]
Use the record macro function to see exactly what you want to switch on and off.
Cheers, Rob.
Bookmarks