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 Open
.
Similarly, I also would like the function to do the same if the status is Closed
.
The main challenge with this code is that I do not want the date to change by using functions like =TODAY()
or =NOW()
, bht instead I would like these dates to be permanent once populated.
Here is an image of the table I am hoping to have this functionality work on.
In terms of code, here is what I was able to muster up:
Function add_todays_date()
If Sheets("Sheet2").Range("C5") = "Open" Then
Sheets("Sheet3").Range("G4").Copy
ActiveWorkbook.Sheets("Sheet2").Range("D5").PasteSpecial Paste:=xlValues