Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
COUNTIFS using an array, but a continual -1 reference | Excel Discussion (Misc queries) | |||
I need to do a continual document merge with excel and word | Excel Discussion (Misc queries) | |||
Inter-spreadsheet Referencing - Continual need to locate linked fi | Excel Discussion (Misc queries) | |||
Copy continual, refreshing records to a new sheet | Excel Programming | |||
Copy continual, refreshing records to a new sheet | Excel Programming |