close

Usually the NOW function does not update until you save or re-open the file
or press calculate (F9).

However I somehow managed to get it to update constantly (so I could have a
countdown clock running). Does anyone know how to do this?

Thanks
Atreides

Probably something like this: www.cpearson.com/excel/ontime.htm

************
Hope it helps!
Anne Troy
www.OfficeArticles.com

quot;Atreidesquot; lt;atreides1AThotmailD0Tcomgt; wrote in message
news
gt; Usually the NOW function does not update until you save or re-open the
gt; file
gt; or press calculate (F9).
gt;
gt; However I somehow managed to get it to update constantly (so I could have
gt; a
gt; countdown clock running). Does anyone know how to do this?
gt;
gt; Thanks
gt; Atreides
Thanks Anne, almost there..

That bit of code sets up a periodically running subroutine... but what to
put in the subroutine? How can I make it so that a specific cell always shows
the instantaneous current time?

Peter

quot;Anne Troyquot; wrote:

gt; Probably something like this: www.cpearson.com/excel/ontime.htm
gt;
gt; ************
gt; Hope it helps!
gt; Anne Troy
gt; www.OfficeArticles.com
gt;
gt; quot;Atreidesquot; lt;atreides1AThotmailD0Tcomgt; wrote in message
gt; news
gt; gt; Usually the NOW function does not update until you save or re-open the
gt; gt; file
gt; gt; or press calculate (F9).
gt; gt;
gt; gt; However I somehow managed to get it to update constantly (so I could have
gt; gt; a
gt; gt; countdown clock running). Does anyone know how to do this?
gt; gt;
gt; gt; Thanks
gt; gt; Atreides
gt;
gt;
gt;

Dim nTime As Double
Sub myClock()
nTime = Now TimeSerial(0, 0, 1) ' 1 secs
Worksheets(quot;Sheet1quot;).Range(quot;A1quot;).Value = Time
Application.OnTime nTime, quot;myClockquot;
End Sub

Sub StopClock()
Application.OnTime nTime, quot;myClockquot;,,False
End Sub

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

quot;Atreidesquot; lt;atreides1AThotmailD0Tcomgt; wrote in message
...
gt; Thanks Anne, almost there..
gt;
gt; That bit of code sets up a periodically running subroutine... but what to
gt; put in the subroutine? How can I make it so that a specific cell always
shows
gt; the instantaneous current time?
gt;
gt; Peter
gt;
gt; quot;Anne Troyquot; wrote:
gt;
gt; gt; Probably something like this: www.cpearson.com/excel/ontime.htm
gt; gt;
gt; gt; ************
gt; gt; Hope it helps!
gt; gt; Anne Troy
gt; gt; www.OfficeArticles.com
gt; gt;
gt; gt; quot;Atreidesquot; lt;atreides1AThotmailD0Tcomgt; wrote in message
gt; gt; news
gt; gt; gt; Usually the NOW function does not update until you save or re-open the
gt; gt; gt; file
gt; gt; gt; or press calculate (F9).
gt; gt; gt;
gt; gt; gt; However I somehow managed to get it to update constantly (so I could
have
gt; gt; gt; a
gt; gt; gt; countdown clock running). Does anyone know how to do this?
gt; gt; gt;
gt; gt; gt; Thanks
gt; gt; gt; Atreides
gt; gt;
gt; gt;
gt; gt;
Thank you, Bob. We both know I could not have answered that.
hugs amp; kisses
************
Hope it helps!
Anne Troy
www.OfficeArticles.com

quot;Bob Phillipsquot; gt; wrote in message
...
gt; Dim nTime As Double
gt; Sub myClock()
gt; nTime = Now TimeSerial(0, 0, 1) ' 1 secs
gt; Worksheets(quot;Sheet1quot;).Range(quot;A1quot;).Value = Time
gt; Application.OnTime nTime, quot;myClockquot;
gt; End Sub
gt;
gt; Sub StopClock()
gt; Application.OnTime nTime, quot;myClockquot;,,False
gt; End Sub
gt;
gt; --
gt;
gt; HTH
gt;
gt; Bob Phillips
gt;
gt; (remove nothere from the email address if mailing direct)
gt;
gt; quot;Atreidesquot; lt;atreides1AThotmailD0Tcomgt; wrote in message
gt; ...
gt;gt; Thanks Anne, almost there..
gt;gt;
gt;gt; That bit of code sets up a periodically running subroutine... but what to
gt;gt; put in the subroutine? How can I make it so that a specific cell always
gt; shows
gt;gt; the instantaneous current time?
gt;gt;
gt;gt; Peter
gt;gt;
gt;gt; quot;Anne Troyquot; wrote:
gt;gt;
gt;gt; gt; Probably something like this: www.cpearson.com/excel/ontime.htm
gt;gt; gt;
gt;gt; gt; ************
gt;gt; gt; Hope it helps!
gt;gt; gt; Anne Troy
gt;gt; gt; www.OfficeArticles.com
gt;gt; gt;
gt;gt; gt; quot;Atreidesquot; lt;atreides1AThotmailD0Tcomgt; wrote in message
gt;gt; gt; news
gt;gt; gt; gt; Usually the NOW function does not update until you save or re-open
gt;gt; gt; gt; the
gt;gt; gt; gt; file
gt;gt; gt; gt; or press calculate (F9).
gt;gt; gt; gt;
gt;gt; gt; gt; However I somehow managed to get it to update constantly (so I could
gt; have
gt;gt; gt; gt; a
gt;gt; gt; gt; countdown clock running). Does anyone know how to do this?
gt;gt; gt; gt;
gt;gt; gt; gt; Thanks
gt;gt; gt; gt; Atreides
gt;gt; gt;
gt;gt; gt;
gt;gt; gt;
gt;
gt;
Thanks Bob, that looks promising, however I'm not sure exactly how to run
this code. I assume that I need a sheet labelelled quot;Sheet1quot; and that the
clock will appear in cell A1? Perhaps I've entered the code wrong.My VBA
module looks like this:

====

Public RunWhen As Double
Public Const cRunIntervalSeconds = 120 ' two minutes
Public Const cRunWhat = quot;The_Subquot;
Sub StartTimer()

RunWhen = Now TimeSerial(0, 0, cRunIntervalSeconds)
Application.OnTime earliesttime:=RunWhen, procedu=cRunWhat, _
schedule:=True
End Sub

Sub The_Sub()

Dim nTime As Double
Sub myClock()
nTime = Now TimeSerial(0, 0, 1) ' 1 secs
Worksheets(quot;Sheet1quot;).Range(quot;A1quot;).Value = Time
Application.OnTime nTime, quot;myClockquot;
End Sub

Sub StopClock()
Application.OnTime nTime, quot;myClockquot;, , False
End Sub

StartTimer

End Sub
Sub StopTimer()
On Error Resume Next
Application.OnTime earliesttime:=RunWhen, _
procedu=cRunWhat, schedule:=False
End Sub

====

Should I have put your block somewhere else?

Thanks
Atreides

You don't need anything on the worksheet, it finds A1 itself (you can change
that to any cell you want).

All you need to do is fire it. Goto menu Toolsgt;Macrogt;Macros... and select
StartTimer from the list, then click Run. You can stop it in a similar
manner.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

quot;Atreidesquot; lt;atreides1AThotmailD0Tcomgt; wrote in message
...
gt; Thanks Bob, that looks promising, however I'm not sure exactly how to run
gt; this code. I assume that I need a sheet labelelled quot;Sheet1quot; and that the
gt; clock will appear in cell A1? Perhaps I've entered the code wrong.My VBA
gt; module looks like this:
gt;
gt; ====
gt;
gt; Public RunWhen As Double
gt; Public Const cRunIntervalSeconds = 120 ' two minutes
gt; Public Const cRunWhat = quot;The_Subquot;
gt; Sub StartTimer()
gt;
gt; RunWhen = Now TimeSerial(0, 0, cRunIntervalSeconds)
gt; Application.OnTime earliesttime:=RunWhen, procedu=cRunWhat, _
gt; schedule:=True
gt; End Sub
gt;
gt; Sub The_Sub()
gt;
gt; Dim nTime As Double
gt; Sub myClock()
gt; nTime = Now TimeSerial(0, 0, 1) ' 1 secs
gt; Worksheets(quot;Sheet1quot;).Range(quot;A1quot;).Value = Time
gt; Application.OnTime nTime, quot;myClockquot;
gt; End Sub
gt;
gt; Sub StopClock()
gt; Application.OnTime nTime, quot;myClockquot;, , False
gt; End Sub
gt;
gt; StartTimer
gt;
gt; End Sub
gt; Sub StopTimer()
gt; On Error Resume Next
gt; Application.OnTime earliesttime:=RunWhen, _
gt; procedu=cRunWhat, schedule:=False
gt; End Sub
gt;
gt; ====
gt;
gt; Should I have put your block somewhere else?
gt;
gt; Thanks
gt; Atreides
Thanks Bob, it works!

I'm really new to Macros so I didn't know you could just run them like that.
I only used them to write functions before.

quot;Bob Phillipsquot; wrote:

gt; You don't need anything on the worksheet, it finds A1 itself (you can change
gt; that to any cell you want).
gt;
gt; All you need to do is fire it. Goto menu Toolsgt;Macrogt;Macros... and select
gt; StartTimer from the list, then click Run. You can stop it in a similar
gt; manner.
gt;
gt; --
gt;
gt; HTH
gt;
gt; Bob Phillips
gt;
gt; (remove nothere from the email address if mailing direct)
gt;
gt; quot;Atreidesquot; lt;atreides1AThotmailD0Tcomgt; wrote in message
gt; ...
gt; gt; Thanks Bob, that looks promising, however I'm not sure exactly how to run
gt; gt; this code. I assume that I need a sheet labelelled quot;Sheet1quot; and that the
gt; gt; clock will appear in cell A1? Perhaps I've entered the code wrong.My VBA
gt; gt; module looks like this:
gt; gt;
gt; gt; ====
gt; gt;
gt; gt; Public RunWhen As Double
gt; gt; Public Const cRunIntervalSeconds = 120 ' two minutes
gt; gt; Public Const cRunWhat = quot;The_Subquot;
gt; gt; Sub StartTimer()
gt; gt;
gt; gt; RunWhen = Now TimeSerial(0, 0, cRunIntervalSeconds)
gt; gt; Application.OnTime earliesttime:=RunWhen, procedu=cRunWhat, _
gt; gt; schedule:=True
gt; gt; End Sub
gt; gt;
gt; gt; Sub The_Sub()
gt; gt;
gt; gt; Dim nTime As Double
gt; gt; Sub myClock()
gt; gt; nTime = Now TimeSerial(0, 0, 1) ' 1 secs
gt; gt; Worksheets(quot;Sheet1quot;).Range(quot;A1quot;).Value = Time
gt; gt; Application.OnTime nTime, quot;myClockquot;
gt; gt; End Sub
gt; gt;
gt; gt; Sub StopClock()
gt; gt; Application.OnTime nTime, quot;myClockquot;, , False
gt; gt; End Sub
gt; gt;
gt; gt; StartTimer
gt; gt;
gt; gt; End Sub
gt; gt; Sub StopTimer()
gt; gt; On Error Resume Next
gt; gt; Application.OnTime earliesttime:=RunWhen, _
gt; gt; procedu=cRunWhat, schedule:=False
gt; gt; End Sub
gt; gt;
gt; gt; ====
gt; gt;
gt; gt; Should I have put your block somewhere else?
gt; gt;
gt; gt; Thanks
gt; gt; Atreides
gt;
gt;
gt;

A whole new world is opening to you lt;Ggt;

Bob

quot;Atreidesquot; lt;atreides1AThotmailD0Tcomgt; wrote in message
...
gt; Thanks Bob, it works!
gt;
gt; I'm really new to Macros so I didn't know you could just run them like
that.
gt; I only used them to write functions before.
gt;
gt; quot;Bob Phillipsquot; wrote:
gt;
gt; gt; You don't need anything on the worksheet, it finds A1 itself (you can
change
gt; gt; that to any cell you want).
gt; gt;
gt; gt; All you need to do is fire it. Goto menu Toolsgt;Macrogt;Macros... and
select
gt; gt; StartTimer from the list, then click Run. You can stop it in a similar
gt; gt; manner.
gt; gt;
gt; gt; --
gt; gt;
gt; gt; HTH
gt; gt;
gt; gt; Bob Phillips
gt; gt;
gt; gt; (remove nothere from the email address if mailing direct)
gt; gt;
gt; gt; quot;Atreidesquot; lt;atreides1AThotmailD0Tcomgt; wrote in message
gt; gt; ...
gt; gt; gt; Thanks Bob, that looks promising, however I'm not sure exactly how to
run
gt; gt; gt; this code. I assume that I need a sheet labelelled quot;Sheet1quot; and that
the
gt; gt; gt; clock will appear in cell A1? Perhaps I've entered the code wrong.My
VBA
gt; gt; gt; module looks like this:
gt; gt; gt;
gt; gt; gt; ====
gt; gt; gt;
gt; gt; gt; Public RunWhen As Double
gt; gt; gt; Public Const cRunIntervalSeconds = 120 ' two minutes
gt; gt; gt; Public Const cRunWhat = quot;The_Subquot;
gt; gt; gt; Sub StartTimer()
gt; gt; gt;
gt; gt; gt; RunWhen = Now TimeSerial(0, 0, cRunIntervalSeconds)
gt; gt; gt; Application.OnTime earliesttime:=RunWhen, procedu=cRunWhat, _
gt; gt; gt; schedule:=True
gt; gt; gt; End Sub
gt; gt; gt;
gt; gt; gt; Sub The_Sub()
gt; gt; gt;
gt; gt; gt; Dim nTime As Double
gt; gt; gt; Sub myClock()
gt; gt; gt; nTime = Now TimeSerial(0, 0, 1) ' 1 secs
gt; gt; gt; Worksheets(quot;Sheet1quot;).Range(quot;A1quot;).Value = Time
gt; gt; gt; Application.OnTime nTime, quot;myClockquot;
gt; gt; gt; End Sub
gt; gt; gt;
gt; gt; gt; Sub StopClock()
gt; gt; gt; Application.OnTime nTime, quot;myClockquot;, , False
gt; gt; gt; End Sub
gt; gt; gt;
gt; gt; gt; StartTimer
gt; gt; gt;
gt; gt; gt; End Sub
gt; gt; gt; Sub StopTimer()
gt; gt; gt; On Error Resume Next
gt; gt; gt; Application.OnTime earliesttime:=RunWhen, _
gt; gt; gt; procedu=cRunWhat, schedule:=False
gt; gt; gt; End Sub
gt; gt; gt;
gt; gt; gt; ====
gt; gt; gt;
gt; gt; gt; Should I have put your block somewhere else?
gt; gt; gt;
gt; gt; gt; Thanks
gt; gt; gt; Atreides
gt; gt;
gt; gt;
gt; gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()