How do I find the date a cell was modified?

G

Gord Dibben

You don't unless you have used event code to store the date/time a cell was
altered.

Do you want to do that?

The code below stores a date/time value in an adjacent cell whenever a cell
in the range A1:A10 is altered.

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:A10")) Is Nothing Then
With Target
If .Value <> "" Then
.Offset(0, 1).Value = Format(Now, "dd mmm yyyy hh:mm:ss")
End If
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub

Right-click on the worksheet tab and "View Code". Copy/paste the code into
that worksheet module.

Edit the range A1:A10 to suit. Alt + q to return to Excel.


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top