Automatic time stamp

D

Da Mann

I was wondering if there's a way to add an automatic time stamp. What I'd
like to do is to add a timestamp to a cell (say, B1) when an entry is made a
seperate cell (say A1). Anyone have any ideas? My research, thus far, has
been fruitless.

Thank you!
 
G

Gord Dibben

This code placed in a worksheet module will do as requested.

Right-click on your sheet tab and select "View Code". Copy/paste this code
into that module.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col A
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

Format Column B cells to time.

Note: the time stamp in B is non-volatile(will not change) unless you go back
and edit a value in column A.

Gord Dibben XL2002
 

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