Time Stamp

S

Sally

How can I set up a time stamp? When someone enters data
into the 1st cell (A1) the date and time are stamped in B1
and so on for A2 thru A10

Thank you
 
B

Bob Phillips

Sally,

You can do it with code

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False
On Error GoTo ws_exit
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
If Target.Count = 1 Then
Target.Offset(0, 1).Value = Format(Date, "dd mmm yyyy hh:mm:ss")
End If
End If

ws_exit:
Application.EnableEvents = True

End Sub

ADd this to the applicable worksheet module.
 
P

Paul B

Sally, try this

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, [a1:a10]) Is Nothing Then
Cells(Target.Row, 2) = Now
End If
End Sub

To put in this macro right click on the worksheet tab and view code, in the
window that opens paste this code, press Alt and Q to close this window and
go back to your workbook. If you are using excel 2000 or newer you may have
to change the macro security settings to get the macro to run.

--
Paul B
Always backup your data before trying something new
Using Excel 97 & 2000
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **
 

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