Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35
Default Continuous calculation of a formula.

I created a Countdown clock to an event in our company. Just the actual
date minus todays date. Anyway, it just calculates days, hours, mins, secs
until an event. The problem is that you either have to hit F9 or some other
cell to get it to re-calculate the formulas. I set up a macro and tied it to
a refresh button but does anyone know how I could get the spreadsheet to
calculate every second automatically or perhaps another way to add a
Countdown clock to my spreadsheet?
Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Continuous calculation of a formula.

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

Run StartTimer to begin and StopTImer to end. The worksheet will be
re-calculated every two seconds.
--
Gary''s Student - gsnu200833


"Husker87" wrote:

I created a Countdown clock to an event in our company. Just the actual
date minus todays date. Anyway, it just calculates days, hours, mins, secs
until an event. The problem is that you either have to hit F9 or some other
cell to get it to re-calculate the formulas. I set up a macro and tied it to
a refresh button but does anyone know how I could get the spreadsheet to
calculate every second automatically or perhaps another way to add a
Countdown clock to my spreadsheet?
Thanks!

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
continuous typing FX Excel Discussion (Misc queries) 2 August 18th 07 07:22 PM
Continuous Averages Formula Mof Excel Worksheet Functions 2 January 27th 06 05:23 PM
continuous sum formula needed NN Excel Discussion (Misc queries) 2 November 4th 05 06:49 PM
Making a formula continuous Neil_Pattison Excel Discussion (Misc queries) 4 October 7th 05 06:09 PM
Formula for Continuous Services Dates pvbridges Excel Worksheet Functions 1 June 19th 05 01:51 AM


All times are GMT +1. The time now is 12:37 PM.

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"