Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Formula Now()

Hello;

In a worksheet single cell I have the formula =NOW(). I need that to run &
show time constantly. However, sometimes it just stops at a certian time and
won't refresh until some other action happens on the worksheet. Any
suggestions on how I can have the time (h,m,s) show in a cell on constant
basis?

Debbie
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Formula Now()

Via code


Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnTime nTime, "UpdateTicker", , False
End Sub

Private Sub Workbook_Open()
Call UpdateTicker
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code

in a standard code module, add

Option Explicit

Public nTime As Long

Sub UpdateTicker()
Worksheets(1).Range("A1").Value = Format(Time, "hh:mm:ss")
nTime = Now + TimeSerial(0, 0, 1)
Application.OnTime nTime, "UpdateTicker"
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Debbie Sheperd" wrote in message
...
Hello;

In a worksheet single cell I have the formula =NOW(). I need that to run

&
show time constantly. However, sometimes it just stops at a certian time

and
won't refresh until some other action happens on the worksheet. Any
suggestions on how I can have the time (h,m,s) show in a cell on constant
basis?

Debbie



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Formula Now()

Hi Bob,

i have inserted this part of the code in "ThisWorkbook":

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnTime nTime, "UpdateTicker", , False
End Sub
Private Sub Workbook_Open()
Call UpdateTicker
End Sub

Than i inserted "Module1" with this code:

Option Explicit
Public nTime As Long
Sub UpdateTicker()
Range("A1").Value = Format(Time, "hh:mm:ss")
nTime = Now + TimeSerial(0, 0, 1)
Application.OnTime nTime, "UpdateTicker"
End Sub

and when i open the workbook the time is inserted into cell A1 but it is not
refreshed any more - there is still the time when the workbook was open. Any
idea why it is not refreshed? Or just exactly write where should be which
part of the code inserted. Many thanks.

Henrich

- - -

€žBob Phillips" napĂ*sal (napĂ*sala):

Via code


Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnTime nTime, "UpdateTicker", , False
End Sub

Private Sub Workbook_Open()
Call UpdateTicker
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code

in a standard code module, add

Option Explicit

Public nTime As Long

Sub UpdateTicker()
Worksheets(1).Range("A1").Value = Format(Time, "hh:mm:ss")
nTime = Now + TimeSerial(0, 0, 1)
Application.OnTime nTime, "UpdateTicker"
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Debbie Sheperd" wrote in message
...
Hello;

In a worksheet single cell I have the formula =NOW(). I need that to run

&
show time constantly. However, sometimes it just stops at a certian time

and
won't refresh until some other action happens on the worksheet. Any
suggestions on how I can have the time (h,m,s) show in a cell on constant
basis?

Debbie




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Formula Now()

Sorry guys, a mis-declared variable.

Replace the line

Public nTime As Long

with

Public nTime As Double

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Henrich" wrote in message
...
Hi Bob,

i have inserted this part of the code in "ThisWorkbook":

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnTime nTime, "UpdateTicker", , False
End Sub
Private Sub Workbook_Open()
Call UpdateTicker
End Sub

Than i inserted "Module1" with this code:

Option Explicit
Public nTime As Long
Sub UpdateTicker()
Range("A1").Value = Format(Time, "hh:mm:ss")
nTime = Now + TimeSerial(0, 0, 1)
Application.OnTime nTime, "UpdateTicker"
End Sub

and when i open the workbook the time is inserted into cell A1 but it is

not
refreshed any more - there is still the time when the workbook was open.

Any
idea why it is not refreshed? Or just exactly write where should be which
part of the code inserted. Many thanks.

Henrich

- - -

"Bob Phillips" napísal (napísala):

Via code


Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnTime nTime, "UpdateTicker", , False
End Sub

Private Sub Workbook_Open()
Call UpdateTicker
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code

in a standard code module, add

Option Explicit

Public nTime As Long

Sub UpdateTicker()
Worksheets(1).Range("A1").Value = Format(Time, "hh:mm:ss")
nTime = Now + TimeSerial(0, 0, 1)
Application.OnTime nTime, "UpdateTicker"
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Debbie Sheperd" wrote in

message
...
Hello;

In a worksheet single cell I have the formula =NOW(). I need that to

run
&
show time constantly. However, sometimes it just stops at a certian

time
and
won't refresh until some other action happens on the worksheet. Any
suggestions on how I can have the time (h,m,s) show in a cell on

constant
basis?

Debbie






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Formula Now()

Bob,

PERFEKT!!! - you did it. MANY THANKS.

Henrich


€žBob Phillips" napĂ*sal (napĂ*sala):

Sorry guys, a mis-declared variable.

Replace the line

Public nTime As Long

with

Public nTime As Double

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Henrich" wrote in message
...
Hi Bob,

i have inserted this part of the code in "ThisWorkbook":

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnTime nTime, "UpdateTicker", , False
End Sub
Private Sub Workbook_Open()
Call UpdateTicker
End Sub

Than i inserted "Module1" with this code:

Option Explicit
Public nTime As Long
Sub UpdateTicker()
Range("A1").Value = Format(Time, "hh:mm:ss")
nTime = Now + TimeSerial(0, 0, 1)
Application.OnTime nTime, "UpdateTicker"
End Sub

and when i open the workbook the time is inserted into cell A1 but it is

not
refreshed any more - there is still the time when the workbook was open.

Any
idea why it is not refreshed? Or just exactly write where should be which
part of the code inserted. Many thanks.

Henrich

- - -

"Bob Phillips" napĂ*sal (napĂ*sala):

Via code


Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnTime nTime, "UpdateTicker", , False
End Sub

Private Sub Workbook_Open()
Call UpdateTicker
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code

in a standard code module, add

Option Explicit

Public nTime As Long

Sub UpdateTicker()
Worksheets(1).Range("A1").Value = Format(Time, "hh:mm:ss")
nTime = Now + TimeSerial(0, 0, 1)
Application.OnTime nTime, "UpdateTicker"
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Debbie Sheperd" wrote in

message
...
Hello;

In a worksheet single cell I have the formula =NOW(). I need that to

run
&
show time constantly. However, sometimes it just stops at a certian

time
and
won't refresh until some other action happens on the worksheet. Any
suggestions on how I can have the time (h,m,s) show in a cell on

constant
basis?

Debbie








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Formula Now()

Bob;

Thanks vm. that will do the trick. Do you know if I can also run another
concurrent On.Time procedure? Or will the second one get messed up 'cause
calling "UpdateTicker" every second?

Do you know why just using =Now() in a cell dosen't work?

Debbie

"Bob Phillips" wrote:

Via code


Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnTime nTime, "UpdateTicker", , False
End Sub

Private Sub Workbook_Open()
Call UpdateTicker
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code

in a standard code module, add

Option Explicit

Public nTime As Long

Sub UpdateTicker()
Worksheets(1).Range("A1").Value = Format(Time, "hh:mm:ss")
nTime = Now + TimeSerial(0, 0, 1)
Application.OnTime nTime, "UpdateTicker"
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Debbie Sheperd" wrote in message
...
Hello;

In a worksheet single cell I have the formula =NOW(). I need that to run

&
show time constantly. However, sometimes it just stops at a certian time

and
won't refresh until some other action happens on the worksheet. Any
suggestions on how I can have the time (h,m,s) show in a cell on constant
basis?

Debbie




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Formula Now()

Should be okay to run another. Only problem comes if they both have the same
scheduled time, don't know which executes first. Do make sure that you use a
different time variable, and you call the correct procedures <g

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Debbie Sheperd" wrote in message
...
Bob;

Thanks vm. that will do the trick. Do you know if I can also run another
concurrent On.Time procedure? Or will the second one get messed up 'cause
calling "UpdateTicker" every second?

Do you know why just using =Now() in a cell dosen't work?

Debbie

"Bob Phillips" wrote:

Via code


Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnTime nTime, "UpdateTicker", , False
End Sub

Private Sub Workbook_Open()
Call UpdateTicker
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code

in a standard code module, add

Option Explicit

Public nTime As Long

Sub UpdateTicker()
Worksheets(1).Range("A1").Value = Format(Time, "hh:mm:ss")
nTime = Now + TimeSerial(0, 0, 1)
Application.OnTime nTime, "UpdateTicker"
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Debbie Sheperd" wrote in

message
...
Hello;

In a worksheet single cell I have the formula =NOW(). I need that to

run
&
show time constantly. However, sometimes it just stops at a certian

time
and
won't refresh until some other action happens on the worksheet. Any
suggestions on how I can have the time (h,m,s) show in a cell on

constant
basis?

Debbie






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regression Leverage Formula (Jerry W. Lewis or Mike Middleton)already have DFITS formula PJ[_3_] Excel Worksheet Functions 2 June 2nd 10 03:45 PM
copy formula down a column and have cell references change within formula brad New Users to Excel 5 May 13th 07 04:38 PM
Formula expected end of statement error, typing formula into cell as part of VBA macro [email protected] Excel Programming 1 July 20th 06 07:58 PM
Cell doesn't show formula result - it shows formula (CTRL + ' doe. o0o0o0o Excel Worksheet Functions 6 November 19th 04 03:13 PM
Commenting custom formula fields/formula on formula editor Muxer Excel Programming 2 July 24th 03 01:02 AM


All times are GMT +1. The time now is 02:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"