sswcharlie
New Member
Hello
I have a macro that needs to be run every say 10 seconds and for a set number of times, say 5. I have tried to combine the two types of code, timeon and repeat codes. Not quite correct yet. Anyone able to assist.
Run every 10 seconds for in this case 5 times
"RefreshData" is the macro to be run
Thankyou Chuck
******
(
Sub RunOnTime()
For X = 1 to 5
' "RefreshData" code to run - in this case, five times
Application.OnTime Date + TimeSerial(0, 0, 10), "RefreshData"
Next X
End Sub
)
**********
I have a macro that needs to be run every say 10 seconds and for a set number of times, say 5. I have tried to combine the two types of code, timeon and repeat codes. Not quite correct yet. Anyone able to assist.
Run every 10 seconds for in this case 5 times
"RefreshData" is the macro to be run
Thankyou Chuck
******
(
Sub RunOnTime()
For X = 1 to 5
' "RefreshData" code to run - in this case, five times
Application.OnTime Date + TimeSerial(0, 0, 10), "RefreshData"
Next X
End Sub
)
**********