LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default loop thru folder looking for files with date code in name

I need to learn a new technique to use for my next activity.

In a macro I need to find all the files in a folder that contain a
string (specified by the user at the start of the macro), typically a
date code and open that file and then do some processing on it.

For instance:

If the folder C:\monthly_reports contains the following files:

Name_1 20090905.xls
Name_2 20090905.xls
Name_3 20090905.xls
Name_1 20090922.xls
Name_2 20090922.xls
Name_3 20090922.xls

and the user asks for reports that contain the string "20090922" in
the file name would open (one at a time) the last three files in the
above folder.

I suspect this is pretty simple but something I haven't done yet.


John Keith

 
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
VBA Macro - Loop through folder and move files to other folders hurlbut777 Excel Programming 9 December 5th 08 05:30 PM
Code to open multiple files from within a folder Karen Excel Programming 0 September 17th 08 08:11 PM
Loop through files in a folder and unprotect sheets Diddy Excel Programming 13 August 15th 08 09:59 AM
Loop thru All Files in a Folder Juan Sanchez Excel Programming 3 July 5th 04 06:38 PM
Loop through all files in a folder Fred Smith Excel Programming 4 June 7th 04 12:30 AM


All times are GMT +1. The time now is 01:40 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"