VBA macro auto run by time help

S

Soonernut

Well i have macro, and i would like it to run at a particular time ever
day. Trying to use wait function and can't figure out where to pu
string.

Any help on matter would be appreciated.

Here's the macro for reference...changed website name to blahblah jus
for kicks...

Range("A1").Select

ActiveCell.FormulaR1C1 = "=TODAY()"
Range("A1").Select
Selection.NumberFormat = "yyyymmdd"
usedate = Format(Sheets("Sheet1").Cells(1, 2), "YYYYMMDD")
Filename = "ftp://blahblahblah/" & usedate & "-da.csv"

Workbooks.Open Filename:
runs fine when use the shortcut key..

Thanks
 
G

Gord Dibben

Sooner

See Chip Pearson's site for coding with the OnTime method.

http://www.cpearson.com/excel/ontime.htm

Note: you can also use Windows Task Scheduler to open Excel and run a
Workbook_Open Macro then save and close Excel if you wanted to do this at some
time when computer is idle.

Gord Dibben Excel MVP
 

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

Top