Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro File Help

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

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro File Help

workbooks.Open Day(Date-1) & ".txt"

testing in the immediate window:

? day(date-1)
17
? day(DateValue("September 1, 2004")-1)
31


--
Regards,
Tom Ogilvy

"alexm999 " wrote in message
...
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 easier
way for me to run only 1 macro and it will automatically grab the
correct previous days file?


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro File Help

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

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro File Help

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

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro File Help

workbooks.open "C:\UDC\" & day(date-1) & ".txt"
cells(day(date-1)+5,1).Activate

--
Regards,
Tom Ogilvy


"alexm999 " wrote in message
...
Here's one more...

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

I'm starting it in Cell A6 and going down 31 cells.


---
Message posted from http://www.ExcelForum.com/





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
2007 Macro to Open File, Delete Contents, Save New File Flintstone[_2_] Excel Discussion (Misc queries) 2 February 1st 10 11:25 PM
Macro to pull data from another file - update name of file Don Excel Discussion (Misc queries) 2 February 10th 09 03:31 PM
Excel '00, 1st file has macros, how to stop macro in 2nd file? kaptandrews Excel Discussion (Misc queries) 0 May 24th 06 03:07 PM
Macro to insert values from a file and save another sheet as a .txt file Frank[_16_] Excel Programming 2 August 28th 03 01:07 AM
Automate open file, update links, run macro, close and save file Geoff[_7_] Excel Programming 2 August 26th 03 10:13 PM


All times are GMT +1. The time now is 08:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"