title: Auto-fill date based on value
body: <p>What the code does:</p>
  
  <p>Enter a name in column C, date populates in column K.</p>
  
  <p>Other:</p>
  
  <ol>
  <li>Drop down in column J can be "registered" or "locked"</li>
  <li>When data is entered in column C it auto populates "registered" in column J</li>
  </ol>
  
  <p>Here is the code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>'Adds date when borrower name is entered
  Private Sub Worksheet_Change(ByVal Target As Range)
      Dim A As Range, B As Range, Inte As Range, r As Range
      Set A = Range("C:C")
      Set Inte = Intersect(A, Target)
      If Inte Is Nothing Then Exit Sub
      Application.EnableEvents = False
          For Each r In Inte
              If r.Offset(0, 8).Value = "" Then
                 r.Offset(0, 8).Value = Date
              End If
          Next r
      Application.EnableEvents = True
  End Sub</code></pre>
  </div>
  </div>
  </p>
  
  <p>I got this code from: <a href="https://stackoverflow.com/questions/26411407/auto-fill-the-date-in-a-cell-when-the-user-enters-information-in-an-adjacent-ce">Auto-fill the date in a cell, when the user enters information in an adjacent cell</a></p>
  
  <p>What I would like the code to do:</p>
  
  <p>If column J is "registered" add date to column K (Which is currently does) </p>
  
  <p>If column J is changed to "locked", add date to column L</p>