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
 

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

Back
Top