now() function

  • Thread starter Thread starter cmied
  • Start date Start date
C

cmied

My sheet needs a real-time clock. I tried the now()
function but it does not automatically update.

Is there a function that will automatically update ?
 
You cannot run more than one process in Excel at a time. If you run a
procedure that
continually updates the time, you would not be able to do anything else.
 
If you use VBA rather than the NOW function you can
assign it to a button which will update everytime you
press it.....
 
cmied said:
My sheet needs a real-time clock. I tried the now()
function but it does not automatically update.

Is there a function that will automatically update ?

See Chip Pearson's site on how to do this sort of thing in VBA.

http://www.cpearson.com/excel/ontime.htm

You can use his code to organise the updating and just use it to set a value
in a cell on your spreadsheet:

Range ("A1") = Now


Hope that helps

Geoff
 
cmied,

Put this in an ordinary module and run it. It'll boot itself continuously.
The clock will stop running while your in Enter or Edit mode, or if another
sub runs continuously.
 
OOPS! Goll-ee. Looks as if someone forgot to paste in the macro.
Couldn't've been moi! Could it?

Sub ClockBump()
Application.OnTime Now() + TimeValue("00:00:01"), "ClockBump"
Range("A1") = Now()
End Sub

Change the range where you want the time to appear. Change the "0:00:01" to
be consistent with how you have the cell time-formatted. For example, if it
doesn't have seconds, then use "0:01:00" for an update every minute.
 
Back
Top