Run Macro every 5secs

dgavin

Active Member
Joined
Feb 16, 2005
Messages
302
Can someone tell me how i can run my workbook macro once every 5secs, continuously.

Many Thanks
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Thanks,

I'm using the ozgrid method, but i get an error in my module. The "Now" is highlighted and error message only comments appear after End Sub, End Function or End Property

Can you help ?


Public dTime As Date
Sub Reset_Staking_Plan()

End Sub

dTime = Now + TimeValue("00:00:05")
Application.OnTime dTime, "Reset_Staking_Plan"

' Reset_Staking_Plan Macro
' Macro recorded 28/11/2007 by
'
Range("K19").Select
ActiveCell.FormulaR1C1 = "=R[2]C"
Range("K20").Select
ActiveCell.FormulaR1C1 = "=R[-18]C[2]"
Range("K21").Select

End Sub
 
Upvote 0
Try

Code:
Public dTime As Date
Sub Reset_Staking_Plan()

dTime = Now + TimeValue("00:00:05")
Application.OnTime dTime, "Reset_Staking_Plan"

' Reset_Staking_Plan Macro
' Macro recorded 28/11/2007 by
'
Range("K19").FormulaR1C1 = "=R[2]C"
Range("K20").FormulaR1C1 = "=R[-18]C[2]"

End Sub
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,134
Members
452,890
Latest member
Nikhil Ramesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top