ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Excell formula or setting to recalculate periodically. (https://www.excelbanter.com/excel-worksheet-functions/235322-excell-formula-setting-recalculate-periodically.html)

Duane S.

Excell formula or setting to recalculate periodically.
 
How can I set up a count down clock in Excell that recalculates a formula on
a repeating basis, not just when the workbook opens or the spreadsheet is
recalculated manually.?

Gary''s Student

Excell formula or setting to recalculate periodically.
 
You can create an Event Macro that will refresh the formulas periodically:

Public whn As Double
Public Const T = 2 ' two seconds
Public Const macroo = "refresh" ' the name of the procedure to run

Sub refresh()
Application.CalculateFull
StartTimer
End Sub


Sub StartTimer()
whn = Now + TimeSerial(0, 0, T)
Application.OnTime EarliestTime:=whn, Procedu=macroo, Schedule:=True
End Sub


Sub StopTimer()
On Error Resume Next
Application.OnTime EarliestTime:=whn, Procedu=macroo, Schedule:=False
End Sub



Macros are very easy to install and use:

1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To use the macro from the normal Excel window:

1. ALT-F8
2. Select the macro, in this case StartTimer
3. Touch Run



To remove the macro:

1. bring up the VBE window as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm


If you want to stop the repeating process, run StopTimer


--
Gary''s Student - gsnu200858


"Duane S." wrote:

How can I set up a count down clock in Excell that recalculates a formula on
a repeating basis, not just when the workbook opens or the spreadsheet is
recalculated manually.?



All times are GMT +1. The time now is 09:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com