Time stamping data


Posted by Steve Fox on October 22, 2001 8:16 PM

I think I have a pretty simple question, but I can't
seem to figure it out. I'm making a spreadsheet to
log tests that need to be conducted every two hours.
Is there a way to input the time automatically when a
specific cell has data entered into it? These tests
are conducted every two hours, twenty-four hours per
day. Let me know if I need to provide more information.

Steve

Posted by Geoffrey Hurst on October 23, 2001 4:13 AM

Try this. It wiil put the date and time in A2 whenever an input is made in A1.
Put it in the Sheet's code module :-

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = [A1] Then [A2].Value = Now()
End Sub


Posted by Geoffrey Hurst on October 23, 2001 4:26 AM

Correction ...


Correction ;_

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then [A2].Value = Now()
End Sub




Posted by Steve Fox on October 26, 2001 5:45 AM

Works; Thanks

Geoffrey,

Thank you. It looks like this does exactly what
I need. I guess it wasn't quite as easy as I thought
it should be. Is there a book you can recommend
for someone to learn more about writing code for
Excel spreadsheets?