Auto date insertion to a cell


Posted by Tom on September 23, 2000 9:19 AM

Does anyone know how I can have the current date inserted in a cell automatically based on input from a different Cell? For example, If I enter any value in A1, todays date will appear as a stamp in A2, and will not change regardless of when I open the file. I was wanting to do this as a function, but I'm not sure it will work.

Thanks

Posted by Tom on September 23, 2000 1:33 PM

Oops... I would want to use this on an entire row (some 1000 entries) So some automation would be nice

Thanks in advance

-Tom

Posted by Celia on September 23, 2000 7:34 PM


Tom
To put the date in Row2 when an entry is input in Row1 :-

Private Sub Worksheet_Change(ByVal Target As Range)
Dim keyRange As Range
Set keyRange = Range("A1:IV1")
If Not Intersect(keyRange, Target) Is Nothing Then
Target.Offset(1, 0) = Date
End If
End Sub

You mention 1,000 entries in your row. Since a row only has 256 cells, you may have meant that you want the date to be entered in Column B when an entry is made in Column A :-

Private Sub Worksheet_Change(ByVal Target As Range)
Dim keyRange As Range
Set keyRange = Range("A:A")
If Not Intersect(keyRange, Target) Is Nothing Then
Target.Offset(0, 1) = Date
End If
End Sub

Celia




Posted by Tom on September 24, 2000 8:55 AM

Celia,

Yes I did mean columns (I gotta stop posting without a full cup of coffee in me)

Worked like a charm.

Thanks, that really helped.

-Tom