Hello,
I have a sheet that automatically updates based on information entered by the user. I need certain cells to be protected, and others not to be. I've tried the following script:
But it gives me the error: "Application-defined or object-defined error"
In the spreadsheet font color changes in a protected cell if data is entered in a different cell. That's what is bringing the error up in break mode. I figured the UserInterfaceOnly syntax would take care of that. Any suggestions?
I have a sheet that automatically updates based on information entered by the user. I need certain cells to be protected, and others not to be. I've tried the following script:
Code:
sh2.Range("B2:D2").Locked = False
sh2.Range("C4:D4").Locked = False
sh2.Range("C5:D5").Locked = False
sh2.Range("B10:B29").Locked = False
sh2.Range("C6:C7").Locked = False
Call sh2.Protect(UserInterfaceOnly:=True)
But it gives me the error: "Application-defined or object-defined error"
In the spreadsheet font color changes in a protected cell if data is entered in a different cell. That's what is bringing the error up in break mode. I figured the UserInterfaceOnly syntax would take care of that. Any suggestions?