auto pick date & time as i enter name help me

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i want to do that as i enter any name in a cell and press enter its automaticly collect the date and time from system to next cell how can i do this plz help me !! thankx
 
If a value is entered in column "a" then column "b" will have the date &
time inserted. Paste this code in the worksheet module.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A:A")) Is Nothing And Target.Count = 1 Then
Target.Offset(0, 1) = Format(Date, "m/d/yy h:mm;@")
End If
End Sub

--
Regards,
Rocky McKinley


auto pick date & time as i enter name said:
i want to do that as i enter any name in a cell and press enter its
automaticly collect the date and time from system to next cell how can i
do this plz help me !! thankx
 
Assuming your Name is entered into Column B (in this example), add this code
to your worksheet

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 2 Then Target.Offset(0, 1).Value = Now()
End Sub

Rob


auto pick date & time as i enter name said:
i want to do that as i enter any name in a cell and press enter its
automaticly collect the date and time from system to next cell how can i
do this plz help me !! thankx
 
right click the sheet tab, select View Code and add the
following code
by the "next cell" one assume the cell to the right of
the one that had the entry. The code uses the CHANGE
event that fires every time an entry is made. The boolean
is set to stop the code when the date is entered.



Option Explicit
Private bStop As Boolean
Private Sub Worksheet_Change(ByVal Target As Range)
If bStop Then
bStop = False
Else
bStop = True
Target.Offset(0, 1).Value = _
Format(Now(), "dd-mmm-yy hh:mm")
End If
End Sub



Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
i want to do that as i enter any name in a cell and
press enter its automaticly collect the date and time
from system to next cell how can i do this plz help
me !! thankx
 
Duplicate posting.

My reply in another section checks which column the data is entered.
think this is better because the example above will run wheneve
anything is entered in the sheet
 
******** MULTIPLE POSTING
This is not necessary as most of us read all the Excel sections.

This could stop us answering *any* of your queries from the assumptio
that you have posted elsewhere
 
Back
Top