Locking cells based on condition

jmaw Posted messages 9 Status Member -  
jmaw Posted messages 9 Status Member -
Hello,
question, can we lock cells based on a specific choice?
For example, if Cell C1 = (Received), then Cell E1 is operational for entering a number and Cell G1 is locked for writing. However, if Cell C1 = (Gift), then Cell E1 is locked for writing and Cell G1 is open for writing.

Can you help me with this? Thank you very much in advance.

joel

2 answers

  1. via55 Posted messages 14393 Registration date   Status Member Last intervention   2 759
     
    Hello

    It's possible:

    - with a VBA macro that locks and unlocks the correct cells when the sheet is activated

    - or more simply without a macro and without locking the cells, by modifying the data validation:
    Position yourself on E1 then Data - Data Validation - Allow: Custom and in Formula, enter: =C1="Received"
    Repeat the operation for G1 with the formula: =C1="Gift"

    Best regards
    Via

    --
    "Imagination is more important than knowledge." A. Einstein
    1
    1. jmaw Posted messages 9 Status Member 1
       
      Hello and thank you, I will test this, without VBA because I admit I am very bad at VBA, so let's test the solution with data validation. I may return to the forum for a VBA solution.

      Kind regards, Joël
      0