Macro File Help

  • Thread starter Thread starter alexm999
  • Start date Start date
A

alexm999

I run a macro that opens up a file that is named for the Previous date
For example, today is Aug 18, 2004 so the file I open will be 17.txt

I have 31 Macro's - 1 each for the day of the week. Is there an easie
way for me to run only 1 macro and it will automatically grab th
correct previous days file
 
workbooks.Open Day(Date-1) & ".txt"

testing in the immediate window:

? day(date-1)
17
? day(DateValue("September 1, 2004")-1)
31
 
Thanks for the quick reply. Here's another question regarding thi
matter.

If the file is in the C:\UDC directory, how will I call this using th
function, i'm having difficulties
 
Here's one more...

After I run the file TODAY, then when i run it tomorrow, i'd like it t
skip to the next row so the first row is not deleted.

I'm starting it in Cell A6 and going down 31 cells
 
workbooks.open "C:\UDC\" & day(date-1) & ".txt"
cells(day(date-1)+5,1).Activate
 

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