Hi all,
I have been trying to write a code that will display the NOW (date&time) in an adjacent cell if the target cell value changes.
The target cell is changed by a formula and references values from another sheet, so Worksheet_Change and circular argument functions will not work.
Therefore, I found a possible solution, which you can see below - it worked once or twice, and now the timestamp will not update. I need the adjacent cell's timestamp to update every time the target cell value changes.
I am new to VBA so I am hoping somebody can take a look and tell me where I am making a mistake in my code.Option Explicit
Private Sub Worksheet_Calculate()
Dim CELL As Range
Application.EnableEvents = False
For Each CELL In Range("B13")
If CELL.Value <> CELL.Offset(, 1).Value Then
With CELL.Offset(1, -1)
.Value = Now
.NumberFormat = "mm/dd/yyyy hh:mm AM/PM"
End With
CELL.Offset(1, -1).Value = Now
End If
Next CELL
Application.EnableEvents = True
End Sub
Thank you all so much for your help.
-A
Bookmarks