VBA macro auto run by time help

  • Thread starter Thread starter Soonernut
  • Start date Start date
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
 
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
 
Back
Top