Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Open file with variable date name based on current date

Hello,

I have a folder containing different .xls report files with the name format
"YYYY MM text.xls", where YYYY stands for year, MM for month.

I need a macro which, when run from an excel file saved in a different
loacation, based on the current date, e.g. January 7, 2009, will open the
file "2009 01 text.xls".

Thanks for your help,
Ciperian
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Open file with variable date name based on current date

Workbooks.Open "C:\Foldername\" & Format(Now(),"yyyy mm") & " text.xls"

Except it will open 2010 01 text.xls ;-)

HTH,
Bernie
MS Excel MVP


"Ciprian" wrote in message
...
Hello,

I have a folder containing different .xls report files with the name format
"YYYY MM text.xls", where YYYY stands for year, MM for month.

I need a macro which, when run from an excel file saved in a different
loacation, based on the current date, e.g. January 7, 2009, will open the
file "2009 01 text.xls".

Thanks for your help,
Ciperian



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
Open text file based on date. Dan Jordan Excel Programming 2 October 8th 06 10:34 PM
to-date total based on current date dreamkeeper Excel Worksheet Functions 3 August 10th 06 09:33 PM
get back to day one based on current date oomyoo Excel Worksheet Functions 2 December 20th 05 07:46 PM
Open file based on yesterday's date ForSale[_59_] Excel Programming 2 September 2nd 05 06:13 AM
Rename file based on current date wira Excel Programming 1 April 29th 05 10:37 AM


All times are GMT +1. The time now is 10:20 AM.

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

About Us

"It's about Microsoft Excel"