How can I made a marco run every hour and a half?

don't have time to try them now, have to go to work, will try them later hope one will work. Thanks
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
still can't get the code to stop running tried the codes that were posted but i don't know much about vba. thanks for the help
 
Upvote 0
What code do you have ??

Basically when using App ontime you make
the call to run a procedure @ a set time.

When this time is reached and the
macro you specified runs you then need to
make a call to disable it other wise ontime
keeps working in the background in the open
Excel app.

Post what you are actually using


Ivan
 
Upvote 0
Ivan this is what I got from this board, I need it to run every 90 Minuets it does this but I need to know haw to cut it off, Thanks

Public ThisTime As Double


Sub startoff()
ThisTime = Now + TimeValue("01:30:00")
Application.OnTime EarliestTime:=ThisTime, Procedure:="DoIt"
End Sub

Sub DoIt()
Application.ScreenUpdating = False
Run "StartOff"
' TEST CODE
Range("A1").Select
Selection.Copy
Range("a65536").Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Try this :-

Dim ThisTime As Date

Sub StartDoingIt()
DoItAgain
End Sub

Sub DoItAgain()
ThisTime = Now + TimeValue("0:01:00")
Application.OnTime ThisTime, "DoItAgain"
DoIt
End Sub

Sub DoIt()
[A1].Copy [A65536].End(xlUp)(2, 1)
End Sub

Sub StopDoingIt()
On Error Resume Next
Application.OnTime ThisTime, "DoItAgain", schedule:=False
End Sub

Sub Auto_Close()
StopDoingIt
End Sub

Note : I have set the time at 1 minute so you can test it.
This message was edited by Escalus on 2002-03-08 18:22
This message was edited by Escalus on 2002-03-08 18:23
 
Upvote 0
:) :)That works! Thanks. Love the way you made the copy A1 thing work! Maybe I will learn a little more someday. :) :)
 
Upvote 0

Forum statistics

Threads
1,214,813
Messages
6,121,705
Members
449,048
Latest member
81jamesacct

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