Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to make sheet continuosly re-calc

Using a macro how can I make excel continously recalc to update the time
showing in a cell?
Thanks
Bob


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default How to make sheet continuosly re-calc

Bob,
If you are going to recalculate your time ( using NOW? for eample)
what condition do you want to have to STOP the calculation.


"Robert Clarke" wrote:

Using a macro how can I make excel continously recalc to update the time
showing in a cell?
Thanks
Bob



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default How to make sheet continuosly re-calc

Bob,

'continously' has different meanings..
i supposed you meant regularly..

i'm not entirely convinced of the merits of a running clock in a
worksheet but here it goes..


''THISWORKBOOK
Option Explicit
Private Sub Workbook_Activate()
If Me.ActiveSheet Is Sheet1 Then startclock
End Sub
Private Sub Workbook_Deactivate()
If Me.ActiveSheet Is Sheet1 Then stopclock
End Sub

''SHEET1
Option Explicit
Private Sub Worksheet_Activate()
startclock
End Sub
Private Sub Worksheet_Deactivate()
stopclock
End Sub


''MODULEx:
Option Explicit
Private Declare Function KillTimer Lib "user32.dll" ( _
ByVal hWnd As Long, _
ByVal nIDEvent As Long) As Long
Private Declare Function SetTimer Lib "user32.dll" ( _
ByVal hWnd As Long, _
ByVal nIDEvent As Long, _
ByVal uElapse As Long, _
ByVal lpTimerFunc As Long) As Long

Dim lngTimer As Long

Public Sub startclock()
the uElapse is set in Milliseconds!
lngTimer = SetTimer(0&, 0&, 1000&, AddressOf DoTimer)
End Sub

Public Sub stopclock()
KillTimer 0&, lngTimer
End Sub

Public Sub DoTimer()
Sheet1.Cells(1, 1) = Time
End Sub



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Toppers wrote :

Bob,
If you are going to recalculate your time ( using NOW? for
eample) what condition do you want to have to STOP the calculation.


"Robert Clarke" wrote:

Using a macro how can I make excel continously recalc to update the
time showing in a cell?
Thanks
Bob



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default How to make sheet continuosly re-calc


OOPS:

Important change if you want to avoid crashes...
(during editing or with modal dialogs)

Public Sub DoTimer()
ON ERROR RESUME NEXT
Sheet1.Cells(1, 1) = Time
End Sub


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to make sheet continuosly re-calc

I want to stop with a button_click event.

Rob

"Toppers" wrote in message
...
Bob,
If you are going to recalculate your time ( using NOW? for

eample)
what condition do you want to have to STOP the calculation.


"Robert Clarke" wrote:

Using a macro how can I make excel continously recalc to update the time
showing in a cell?
Thanks
Bob





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
How do I continuosly add from list Brown Excel Discussion (Misc queries) 1 April 12th 09 02:52 PM
auto calc on, but have to edit (f2) cells to force re-calc..help! Curt Excel Worksheet Functions 3 February 13th 06 06:05 PM
Suspend calc of formula using a non-existent sheet mikeburg Excel Discussion (Misc queries) 4 December 2nd 05 12:48 AM
Need Excel sheet-calc compounded future value of quarterly flows golfnut Excel Discussion (Misc queries) 1 November 11th 05 04:40 AM
How do you calc half day annual leave on a xls spread sheet using. RGayle_Imperial Excel Worksheet Functions 5 March 8th 05 08:34 PM


All times are GMT +1. The time now is 07:32 AM.

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

About Us

"It's about Microsoft Excel"