title: Excel - Lock Range of Cells Based on Values
body: <p>Is it possible to lock a particular range of cells based on the input from a dropdown in a row of data?</p>
  
  <p>For example, each row of my spreadsheet represents a patient, and the first cell asks a question, to which a "Yes" or "No" response is required (which is selected/entered via a dropdown).</p>
  
  <p><strong>EDIT</strong></p>
  
  <p><strong>The "Yes/No" cell is, in fact, a merge of two cells (G13 &amp; H13).  I have updated my example to reflect this.</strong></p>
  
  <p><strong>EDIT ENDS</strong></p>
  
  <p>If the user selects "No", then I wish to lock the remainder of the range of questions (G13-H13:AB13) as there is no need to enter data here.  However, if the user selects, "Yes", then the remainder of the cells shall remain available to enter data into.</p>
  
  <p>All cells within each range have data entered via dropdowns only.</p>
  
  <p>Here is what I am hoping to achieve:</p>
  
  <pre><code>If "No"
      Then lock range G13-H13:AB13
  Else If "Yes"
      Then do nothing
  
  i.e.
  
   G13-H13  I13-J13  K13-L13   ....     ....     AB13
  |  NO   |  ----  |  ----  |  ----  |  ----  |  ----  |  (Locked Cells)
  
  OR
  
   G13-H13  I13-J13  K13-L13   ....     ....     AB13
  |  YES  |        |        |        |        |        |  (Unlocked Cells)
  </code></pre>
  
  <p>Once again, I would like to emphasize that all data is entered via dropdown menus and that nothing is to be typed in manually; I would like it so that if <code>G13-H13 = "No"</code>, then the remainder of the cells within the range which have dropdowns are blocked or locked from having further information selected from their respective dropdowns.</p>
  
  <p>Please note that the value in G13-H13 can be either "Yes" or "No". </p>
  
  <p>Can this be achieved using VBA and if so, how?</p>
  
  <p>Many thanks.</p>