Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I continuosly add from list | Excel Discussion (Misc queries) | |||
auto calc on, but have to edit (f2) cells to force re-calc..help! | Excel Worksheet Functions | |||
Suspend calc of formula using a non-existent sheet | Excel Discussion (Misc queries) | |||
Need Excel sheet-calc compounded future value of quarterly flows | Excel Discussion (Misc queries) | |||
How do you calc half day annual leave on a xls spread sheet using. | Excel Worksheet Functions |