Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unprotect worksheet from VBA question 1

Status
Not open for further replies.

newboy18

MIS
Apr 11, 2003
45
GB
Please help, I have a sheet in a workbook that has password protected cells.
I want to change the contents of some these cells in VBA but I would need the routine to unprotect the sheet, update the cells and then re-protect the sheet with the same password.
Is this possible, if so how.
 
See thread707-522755 for protecting with "UserInterfaceOnly"
 
Sub Unprotector
Sheets("SheetName").Unprotect("PasswordHere")
...
' Other lines of code here
...
Sheets("SheetName").Protect("PasswordHere")
End Sub

Simmy
 
Thanks guys, this works fine. VBA is like a mountain and I seem to have just climbed the first step - and that is after reading 2 books on the subject.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top