Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col A
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then
n = Target.Row
If Excel.Range("A" & n).Value <> "" Then
Excel.Range("B" & n).Value = Format(Now, "dd mm yyyy h:mm:ss AM/PM")
End If
End If
enditall:
Application.EnableEvents = True
End S
As you enter data in column A, the date/time will be entered in column B
This is worksheet event code. Right-click on the sheet tab and "View Code".
Copy/paste into that sheet module. Adjust to suit. Alt + q to return to the
Excel window.
Gord Dibben MS Excel MVP