Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Get current time NOW() but stop it updating

12,351 views
Skip to first unread message

goneil

unread,
Sep 29, 2009, 5:32:01 AM9/29/09
to
I want to time stamp a cell automatically with the current time (ie) without
the data entry operator having to do anything, however I don't want it to
update all the time I want it to just remain as is permenantly. I cannot
make NOW() stay the same.
Cheers


Stefi

unread,
Sep 29, 2009, 5:38:02 AM9/29/09
to
You can do that via a VBA event macro, but first you have to specify
1. in what cell do you want to enter NOW
2. what is the event (e.g. filling in a particular cell) triggering time
stamping.

Regards,
Stefi

„goneil” ezt írta:

trip_to_tokyo

unread,
Sep 29, 2009, 5:46:01 AM9/29/09
to
Ctrl plus the shift key plus the ; (semi-colon) (hit all 3 keys at the same
time) will return the current time in the cell and it will not be updated.

Please hit Yes if my comments have helped.

Thanks!

trip_to_tokyo

unread,
Sep 29, 2009, 5:48:08 AM9/29/09
to
Ctrl and the ; (semi colon) hit simultaneously will return the current date
to a cell and it will not be updated.

Please hit Yes if my comments have helped.

Thanks!

trip_to_tokyo

unread,
Sep 29, 2009, 5:51:01 AM9/29/09
to
From MS documentation:-

to insert the current date and time, press CTRL+; (semi-colon), then press
SPACE, and then press CTRL+SHIFT+; (semi-colon).

Please hit Yes if my comments have helped.

Thanks!

Jacob Skaria

unread,
Sep 29, 2009, 5:53:02 AM9/29/09
to
To record the timestamp manually you can hit Ctrl+; followed by space bar and
followed by Ctrl+Shift+;

To record the timestamp automatically you cannot use a formula. You will
have to use a VBA solution. Select the sheet tab which you want to work with.
Right click the sheet tab and click on 'View Code'. This will launch VBE.
Paste the below code to the right blank portion. Get back to to workbook and
try out.

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A1:A20")) Is Nothing Then
If Target.Count = 1 Then _
Range("C" & Target.Row) = Format(Now, "mmm dd, yyyy h:mm AMPM;@")
End If
Application.EnableEvents = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria

Stefi

unread,
Sep 29, 2009, 6:20:01 AM9/29/09
to
Yes, but this solution doesn't meet the OP's requirement "without the data
entry operator having to do anything"!

Stefi


„trip_to_tokyo” ezt írta:

Ms-Exl-Learner

unread,
Sep 29, 2009, 7:29:01 AM9/29/09
to
Try this.

Past the below code in Excel VBA Module and assign shortcut key for that.

Press ALT+F11 and go to Insert and click Module. And paste the below code.

Sub DateandTime()
ActiveCell = Now()
End Sub

After pasting the code close the VBA and press ALT+F8, the DateandTime Macro
will appear. Just select it and select Options and give your desired
keyboard button as shortcut key to run the macro.

If you want to show the cells including seconds just select the cells and
Goto Format and select custom and paste this format [$-409]m/d/yy h:mm:ss
AM/PM;@

If this post helps, Click Yes!

--------------------
(MS-Exl-Learner)
--------------------

Ms-Exl-Learner

unread,
Sep 29, 2009, 7:37:03 AM9/29/09
to
My post will not solve your problem, since it needs to be done manually. So,
Pls ignore my post.

--------------------
(Ms-Exl-Learner)
--------------------

goneil

unread,
Sep 29, 2009, 10:21:02 PM9/29/09
to
Hi Stefi,

Thank you for your response, much appreciated. I think this may not be
possible and perhaps thats why I cant figure it out on my own (I also don't
know VBA) or with community help.

I have a spreadsheet that I want to record how much time I spend on each
call I make or receive. I need to do it efficiently because I may only spend
1 or 2 minutes on some calls or less but rounded up to a minimum 1 minute.

I want to simply enter the Duration of the call and Nothing Else:

1. Enter call Duration hh mm into separate cells, then populate other cells
by:
2. Get the Current Time
3. Subtract the call duration from Current Time
4. And that becomes my Start Time.

The problem is that the end time keeps updating because it gets the current
timestamp from NOW().

A B C D
Duration -----------Time---------
Hours Mins Start End
1 20 9:40 11:00
(NOW - Duration) (NOW)

Any ideas Stefi?
cheers
George

Stefi

unread,
Sep 30, 2009, 3:21:02 AM9/30/09
to
Install this Change event macro (first format columns C:D to the desired time
format):

Open VBA (Alt+F11)!
Right click on your worksheet name in the Project explorer window!
Select View code from the popup menu!
Copy/Paste macro code below in the code window!

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Column <= 2 Then 'columns A and B
Range("C" & Target.Row) = Time - TimeSerial(Range("A" & Target.Row),
Range("B" & Target.Row), 0)
Range("D" & Target.Row) = Time
End If
End Sub

goneil

unread,
Sep 30, 2009, 11:40:01 PM9/30/09
to
Great result Stefi, thank you.
George

ctil...@gmail.com

unread,
Nov 1, 2013, 1:13:53 PM11/1/13
to
Worked like a charm, thanks

adflix.j...@globepartners.com.ph

unread,
Sep 2, 2017, 9:49:30 PM9/2/17
to
But its not formula.

aomm...@gmail.com

unread,
Nov 11, 2017, 1:15:06 PM11/11/17
to
There is not CTRL key in ipad.

ismai...@somaiya.edu

unread,
Apr 24, 2018, 2:41:39 AM4/24/18
to
I have a similar query. I want to generate a timestamp in Column C whenever someone enters any complaint in Column B.
So I have used this formula in all the cells of Column C
"=IF(B3="","",TEXT(NOW(),"dd/mm/yy/hh:mm"))"

But the problem is that the timestamp keep getting updated. I want to lock it down to the initial timestamp.
Can you suggest any code for this?
Thanks

--

<https://www.somaiya.edu>        <http://www.somaiya-ayurvihar.org
<http://nareshwadi.org>  <http://somaiya.com>  <http://www.helpachild.in
<http://nareshwadi.org>

nexius.joh...@gmail.com

unread,
Apr 2, 2019, 11:02:03 AM4/2/19
to
Has anyone come up for a solution to this one? I would also like to do the same. I would like to enter a callers name into column C, then have the NOW time populate into column B. currently this works but it will update. I would like to know how to eliminate the updating.

iliace

unread,
Apr 2, 2019, 2:30:06 PM4/2/19
to
One solution without VBA is to use circular reference to stop the cell from calculating. For example, in cell A1:

=IF(A1=0, NOW(), A1)

But you have to have circular references turned out, which might slow down calculations and cause unintended consequences.

chris...@gmail.com

unread,
Apr 7, 2019, 2:17:13 AM4/7/19
to
I think this will work if I am correctly understanding what is trying to be done:


Cells(1, 1).value = now()


This should time stamp cell A1 and not update. It would just need to be used as a macro or as part of a macro.
0 new messages