Formula, can anyone help

  • Thread starter Thread starter JDRasq
  • Start date Start date
J

JDRasq

Hello,
I need some help with this asap please
I have a table which I have set out like this


Date and time ¦ Column 1



I would like it so that If I enter data into column 1, the date an
time will automatically appear, the problem is thatwhen I used th
=now() formula, it worked fine for the first piece of data,but the
when I updated the second, it changed the first date and time,

Can anybody help me please?
Thanks, JDRas
 
Not a formula, but VBA


Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "B:B"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
.Offset(0, -1).Value = Format(Now, "dd mmm yyyyy hh:mm:ss")
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub


'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Good afternoon JDRasq

The question that you're asking cannot be resolved without using VBA
however a quicker and easier solution might be to use the keyboar
shortcut ctrl + ; which will place the current time and date into th
currently active cell.

This will be "stamped" at the current time and will not be changed th
next time the cell is edited.

HTH

Dominic
 

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

Back
Top