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
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
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
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.