Automation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know whether it is possible to code a spreadsheet to perform a
task at a particular time, eg 7am on a Monday? if so does the spreadsheet
have to be open?

Please reply to: cjneth(remove this bit)@aol.com
 
hi,
Read up on the ontime event in help. there are 2.
yes the spread sheet has to be open.
I use the ontime event to run a series of macros each
morning at 5:00am. i use the other ontime event to skip
weekends.
my code.
Sub macALaunchMR()

If Weekday(Now()) = 6 Then '1 = Sunday, 2 = Monday, 3
= Tuesday, ect
'ActiveCell.FormulaR1C1 = "This macro will not start
until 5:00am " & Date + 2.5

Application.OnTime Now() + 2.5 + TimeValue
("00:00:03"), "macAStart"
Else
Application.OnTime TimeValue
("05:00:00"), "macAStart"
End If

End Sub
caution: this wrapped big time.
good luck
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top