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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error Unprotecting Cell

Status
Not open for further replies.

DYM03

Technical User
Mar 6, 2003
28
US
I am using the line of code below to unprotect a protected cell when a specific value is entered in an input box. I keep getting an object defined or application defined error. I have tried a number of ways to do this but nothing is working. Any help or suggesstions would be appreciated.

Worksheets("MASTER").Range("G43").Locked = False
 
The 'Locked' and 'FormulaHidden' properties of range tell excel what to do when worksheet is protected. If both set to true, locked cells can't be changed and formulas are not visible in the formula bar.
They can be changed only when worksheet is not protected.

You need either to set this before you protect worksheet or temporarily unprotect it. You can also protect worksheet with [tt]UserInterfaceOnly:=True[/tt] (this is not saved, so has to be run every time you open the worbook).

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top