Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default continual updating


is there a way to have a caption update once every 1 minute? or every 5
minutes? My form is going to be keeping track of money that is being
spent, but I currently I have to click the update button when I want it
to update, where as if it auto-updates, it will save me some time...any
ideas???


--
dok112
------------------------------------------------------------------------
dok112's Profile: http://www.excelforum.com/member.php...o&userid=10581
View this thread: http://www.excelforum.com/showthread...hreadid=471815

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default continual updating

The below code, place in a standard code module should do the trick.
Replace the line "RefreshMyCaption" with whatever your refresh procedure
is named.

HTH,
Gareth

Private Constant SyncFreqInMinutes as integer = 1
Private myOnTime As Date

Sub SetAutoUpdate
'cancel any outstanding events - just in case
'it's not strictly necessary.
CancelAutoUpdate 'just in case

'work out when you want the next update to take place
myOnTime = Now + Timeserial(0,1,0)

'set the next update to take place
Application.OnTime myOnTime , "SetAutoUpdate"

'rename as to whatever the procedure is to drive the
'refresh
RefreshMyCaption

End Sub

Sub CancelAutoUpdate()
On Error Resume Next
Application.OnTime EarliestTime:=myOnTime , _
Procedu="SetAutoUpdate", _
Schedule:=False
End Sub

dok112 wrote:
is there a way to have a caption update once every 1 minute? or every 5
minutes? My form is going to be keeping track of money that is being
spent, but I currently I have to click the update button when I want it
to update, where as if it auto-updates, it will save me some time...any
ideas???


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default continual updating


it works beautifully! THANKS!!


--
dok112
------------------------------------------------------------------------
dok112's Profile: http://www.excelforum.com/member.php...o&userid=10581
View this thread: http://www.excelforum.com/showthread...hreadid=471815

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default continual updating

You're welcome - thanks for letting me know.

Note that I just spotted I should have written:

'work out when you want the next update to take place
myOnTime = Now + Timeserial(0,SyncFreqInMinutes ,0)

rather than

'work out when you want the next update to take place
myOnTime = Now + Timeserial(0,1,0)

Of course it will still work the same - since SyncFreqInMinutes was set
as 1 anyway - but it you want to change the frequency to 2 or 3 minutes,
say, you just change the constant SyncFreqInMinutes to 2 or 3 etc. And
of course you could always change it to work with seconds.

G

dok112 wrote:
it works beautifully! 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
COUNTIFS using an array, but a continual -1 reference Anthony Excel Discussion (Misc queries) 1 October 12th 09 11:42 PM
I need to do a continual document merge with excel and word Patrick Excel Discussion (Misc queries) 9 October 25th 07 09:57 PM
Inter-spreadsheet Referencing - Continual need to locate linked fi Atreides Excel Discussion (Misc queries) 0 February 22nd 05 07:01 AM
Copy continual, refreshing records to a new sheet EduardoDon[_3_] Excel Programming 0 October 13th 04 08:27 PM
Copy continual, refreshing records to a new sheet EduardoDon[_2_] Excel Programming 1 October 12th 04 07:01 PM


All times are GMT +1. The time now is 11:36 PM.

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

About Us

"It's about Microsoft Excel"