I have a checkbox (Check Box 13) that I want to lock a range of cells and enter the text N/A when it's checked, but be unlocked and able to accept text when the checkbox is unchecked. I have assigned the following macro to a command button (cmdRoll) on the sheet. The checkbox does enter the text N/A when checked and it does lock the range of cells, but if it's unchecked it does not unlock the cells so that text can be entered. I want the specified range of cells to lock when the check box is checked, and the same range to unlock when the checkbox is unchecked. The whole thing only works if the Protect Sheet is on using the pw secret. If I turn off the Protect Sheet, then the code for the range C13:C19,D13:D19 can be altered, which I do not want. I want this code to be in each cell of the range when the checkbox is unchecked:
=IF(E10=TRUE, "N/A", "")
But I want the range to be able to fillable with any text if the box is unchecked. If it's checked again, I want the above code to be reinserted.
The sheet is protected with the pw secret.
Here is the macro code attached to the command button:
What code do I need to make the command button macro unlock the cells C13:C19,D13:D19 if the button is unchecked and assign =IF(E10=TRUE, "N/A", "") to the cells if the checkbox is checked, deleting any text that was inserted when the box was unchecked?Please Login or Register to view this content.
Thank you.
Bookmarks