logging date & time of data entry for individual cell

  • Thread starter Thread starter Julz
  • Start date Start date
J

Julz

I'd like to log the time & date that content was entered into a (formerly
empty) cell.

When any data is manually entered into cell A1, the then-current time & date
goes into cell B1 (and henceforth doesn't change). When data is entered into
A2, the then-current time & date goes into cell B2. Once data has been
entered into a cell, it will not be edited again.

Can anyone suggest the best way of doing this?

Thanks!

Julz
 
Put the following macro in the worksheet code area:

Private Sub Worksheet_Change(ByVal Target As Range)
Set r = Range("A:A")
If Intersect(Target, r) Is Nothing Then Exit Sub
Application.EnableEvents = False
Target.Offset(0, 1).Value = Now()
Application.EnableEvents = True
End Sub
 
Wonderful - many thanks!

Happy Christmas,

Julz

Gary''s Student said:
Put the following macro in the worksheet code area:

Private Sub Worksheet_Change(ByVal Target As Range)
Set r = Range("A:A")
If Intersect(Target, r) Is Nothing Then Exit Sub
Application.EnableEvents = False
Target.Offset(0, 1).Value = Now()
Application.EnableEvents = True
End Sub
 
That doesn't check for already entered date though:

Private Sub Worksheet_Change(ByVal Target As Range)
Set r = Range("A:A")
If Intersect(Target, r) Is Nothing Then Exit Sub
Application.EnableEvents = False
if Target.Offset(0,1).Value = "" then
Target.Offset(0, 1).Value = Now()
end if
Application.EnableEvents = True
End Sub
 
Back
Top