Excel Refresh

.Justin

Registered User.
Local time
Today, 05:30
Joined
Jun 29, 2009
Messages
38
Hi All,

My friend has given be the following code to use for my spreadsheet to update automatically. It currently does this every minute. Is it possible to allow this to happen every 10 seconds and if so where do I change the code? As I can see nothing obvious.

Thanks

Code:
Public RunWhen As Double
Public Const cRunIntervalSeconds = 60
Public Const cRunWhat = "TheSub"

Sub StartTimer()

RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds)
Application.OnTime earliesttime:=RunWhen, procedure:=cRunWhat, _
     schedule:=True
End Sub
Sub TheSub()
'
Calculate
'
StartTimer

End Sub
Sub StopTimer()
   On Error Resume Next
   Application.OnTime earliesttime:=RunWhen, _
       procedure:=cRunWhat, schedule:=False
End Sub
 

Users who are viewing this thread

Back
Top Bottom