Locking/Unlocking Cells Based on Value in Another Cell
I need to unlock a cell based on whether or not another cell in the first cell's row contains a specific value.
Attached is a sample workbook where I need to evaluate range C6:C23 and see if any cells in that range contains (not necessarily equal) the value in cell E3 and if it does then the cells 2 and 3 columns to the right are unlocked for editing.
I would like this code to execute when the worksheet is activated.
I have got round similar issues by using custom Data Validation.
You can use a formula to validate an entry into a cell.
When the check on the other cell is verified to disable entry (Lock cell) set the validation rule such that the entry is impossible to be valid eg if numerical entry >0 AND <0, the entry can't be both so will be rejected; if text "contains 200 z's" although not impossible is unlikely.
When the check on the other cell is verified and will allow entry then you can set the validation to be anything.
You can use a formula to validate an entry into a cell.
When the check on the other cell is verified to disable entry (Lock cell) set the validation rule such that the entry is impossible to be valid eg if numerical entry >0 AND <0, the entry can't be both so will be rejected; if text "contains 200 z's" although not impossible is unlikely.
When the check on the other cell is verified and will allow entry then you can set the validation to be anything.
Thanks
Rob H