Time Stamping

  • Thread starter Thread starter Marty
  • Start date Start date
M

Marty

Does anyone know how to "Time Stamp" a cell as data is
entered into an adjacent cell? I need it to be in
minutes and seconds, and to not change when the
spreadsheet is regenerated. The "NOW" function works
great, except that it updates.

Thanks for any help.
 
Marty

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col A
'Time Stamp placed in Col B
On Error GoTo enditall
If Target.Cells.Column = 1 Then
n = Target.Row
If Excel.Range("A" & n).Value <> "" Then
Excel.Range("B" & n).Value = Now
End If
End If
enditall:
End Sub

Right-click on sheet tab and "View Code". Copy/paste the above code to
worksheet module.

Gord Dibben Excel MVP
 
Back
Top