Computing.Net > Forums > Office Software > Excel: Automatic time update in cel

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Excel: Automatic time update in cel

Reply to Message Icon

Name: Bignelis
Date: February 1, 2008 at 10:23:26 Pacific
OS: Windows XP
CPU/Ram: Centrino Duo 2GB Ram
Product: HP
Comment:

Hi,

I would like to create an automatic time-tracker. In order to do so I need to have the actual time in a cell. When I use the NOW() function this only updates when I press F9. Is there any way to automate this?

Thanks!



Sponsored Link
Ads by Google

Response Number 1
Name: DerbyDad03
Date: February 1, 2008 at 11:54:58 Pacific
Reply:

Paste this code into a regular module and run the StartTimer code.

Public RunWhen As Double
' Set interval to 1 second
Public Const cRunIntervalSeconds = 1
' Define name of procedure to run
Public Const cRunWhat = "The_Timer"

Sub StartTimer()
RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds)
Application.OnTime _
EarliestTime:=RunWhen, _
Procedure:=cRunWhat, _
Schedule:=True
End Sub

Sub The_Timer()
With [A1]
.Formula = "=now()"
.NumberFormat = "hh:mm:ss;@"
End With
StartTimer
End Sub


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: Excel: Automatic time update in cel

Creating a Time card in Excel www.computing.net/answers/office/creating-a-time-card-in-excel/8637.html

Excel 2002 doesnt open in XP www.computing.net/answers/office/excel-2002-doesnt-open-in-xp/2257.html

Help with time arithmetic in Access www.computing.net/answers/office/help-with-time-arithmetic-in-access/5572.html