title: Copy and Paste Today's Date in Excel
body: <p>I am currently trying to create a function that auto-populates the current date in a cell only if the cell adjacent to it contains the text <code>Open</code>. </p>
  
  <p>Similarly, I also would like the function to do the same if the status is <code>Closed</code>. </p>
  
  <p>The main challenge with this code is that I do not want the date to change by using functions like <code>=TODAY()</code> or <code>=NOW()</code>, bht instead I would like these dates to be permanent once populated. </p>
  
  <p>Here is an image of the table I am hoping to have this functionality work on.</p>
  
  <p><a href="https://i.stack.imgur.com/Hxs6D.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Hxs6D.jpg" alt="enter image description here"></a></p>
  
  <p>In terms of code, here is what I was able to muster up:</p>
  
  <pre><code>Function add_todays_date() 
  
      If Sheets("Sheet2").Range("C5") = "Open" Then 
          Sheets("Sheet3").Range("G4").Copy 
          ActiveWorkbook.Sheets("Sheet2").Range("D5").PasteSpecial Paste:=xlValues
  </code></pre>