Timestamp using VBA based on specific cell changes
Hi experts,
Hope you are well!
I am trying to get VBA to update a cell in one column with a timestamp of when another cell changes.
The attached code works well but when I use a filter on the spreadsheet, the code updates the timestamp to the current time when the actual cell has not been clicked or changed.
Is there anyway to better this code?
Function MyTimestamp(Reference As Range)
If Reference.Value <> “” Then
MyTimestamp = Format(Now, “dd-mm-yyyy hh:mm:ss”)
Else
MyTimestamp = “”
End If
End Function
See attached example
Thank you in advance
Matt
Hi experts,Hope you are well! I am trying to get VBA to update a cell in one column with a timestamp of when another cell changes. The attached code works well but when I use a filter on the spreadsheet, the code updates the timestamp to the current time when the actual cell has not been clicked or changed. Is there anyway to better this code? Function MyTimestamp(Reference As Range)
If Reference.Value <> “” Then
MyTimestamp = Format(Now, “dd-mm-yyyy hh:mm:ss”)
Else
MyTimestamp = “”
End If
End Function See attached example Thank you in advance Matt Read More