Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / August 2007

Tip: Looking for answers? Try searching our database.

How do I calculate at timed intervals?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
qaf - 23 Aug 2007 00:17 GMT
I want to perform calculations at timed intervals.  I wrote the
following macro:

Public Function CalcNow(CurTime As Date) As Boolean
Static bInitialized As Boolean
Static StartTime As Date, EndTime As Date
Dim TimeDiff As Double

If Not bInitialized Then
    StartTime = Now()
    EndTime = Now()
    bInitialized = True
End If
EndTime = Now()
TimeDiff = (EndTime - StartTime) * 86400
If TimeDiff > 5 Then
    Application.Calculate
    StartTime = Now()
End If
End Function

The current time is in cell A1 and I pass that value to trigger the
running of the function every second - BUT since I am in manual
calculation mode, cell A1 does not update - UGH!!

Any suggestions are appreciated.
Gary Brown - 23 Aug 2007 03:00 GMT
forget about the CurrTime.
Make the Function a Sub and run it.
Signature

HTH,
Gary Brown
gary.DeleteThis2SendMeAnEmail.Brown@kinneson.com
If this post was helpful to you, please select
''''''''''''''''YES'''''''''''''''' at the bottom of the post.

> I want to perform calculations at timed intervals.  I wrote the
> following macro:
[quoted text clipped - 22 lines]
>
> Any suggestions are appreciated.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.