View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gareth[_7_] Gareth[_7_] is offline
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???