How to lock cells when they reach a specific value?

ArtieB

New Member
Joined
Jul 20, 2022
Messages
1
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hi!

I'm pretty new to Excel, so please excuse me if this is an obvious solution:-
I'm trying to make a "escape room game" of sorts in Excel using minimal VBA/Macros. Everything in my game refers to a table with simple binary yes/no values (e.g., Is the door open? 1 = Yes, 2 = No). My initial idea was that, when the player decides to open the chest of drawers, the "Does the player have the key?" value would change from 1 to 2 using an IF statement ( =IF([text box]="You got the key!", "2", "1") ) ; but when the player does anything after that, the IF statement would obviously revert back to 1, because the text that the IF statement was referring to ("You got the key!") has now changed.
My question is, is there any way to lock the value of the cell so it doesn't change once the cell's value has reached 2? Preferably without VBA/Macros, but if that's the only way, it's fine.

Thanks all!
-Artie
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
It certainly is possible using macros. However I do not follow your logic. I am assuming the chest is locked. and as long as the user does not have the key (key value =2), it should not be possible to open the chest. If doing something the user gets the key, the key value changes to 1, and the user can open the chest.
 
Upvote 0

Forum statistics

Threads
1,213,560
Messages
6,114,304
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top