title: Auto Update Timestamp in Excel
body: <p>I'm currently working on a sheet that has to automatically insert todays date in a cell, if another cell is = "Yes"</p>
  
  <p>I currently have this line of code (that I found online):</p>
  
  <pre><code>Private Sub Worksheet_Change(ByVal Target As Range)
  
    Dim cell As Range
      If Not Intersect(Target, Range("G:G")) Is Nothing Then
          Application.EnableEvents = False
          For Each cell In Target
              cell.Offset(0, 4).Value = Now
              cell.Offset(0, 4).NumberFormat = "dd/mm/yyyy"
          Next cell
      End If
      Application.EnableEvents = True
  End Sub
  </code></pre>
  
  <p>The problem is that the updated cell in row K is being updated every time the cell is changed, and it should only be updated when the cell in row G = "Yes"</p>
  
  <p>I appreciate the help :)</p>