To run marco at a specific time in the day

  • Thread starter Thread starter chucklee
  • Start date Start date
C

chucklee

Hi everyone,

I created a marco to copy and paste certain data from one spreadsheet
to another. I would like to run this marco at 8:00 pm every night. Is
there a way to set a timer to run this macro automatically at 8:00 pm
every night.

Any help on this will be greatly appreciated.

Regards,
Chuck
 
Chuck,

Take a look in the help at "Application.OnTime"

Grtz,
Rody

"
 
thanks for your help.

now, I have the following codes written:


Sub Archive()

Application.OnTime TimeValue("12:02:00"), "Grab_data", schedule = True

End Sub

It looks like i will have to run this macro everytime when i open the
spreadsheet in order to make it work. is that true? Is there anyway
to get around this? I am not the only user to use the spreadsheet, I
am just worried that other user may forget to run this when they open
the spreadsheet.

Again, thanks for the help

regards,
chuck
 
Hi Chucklee,

You could set the OnTime parameters in the Workbook_Open event or use the
Auto_Open macro.

See also Chip Pearson's notes on using Windows timers in the previously
suggested link.
 

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