Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find file problem

Status
Not open for further replies.

mgreich

MIS
Aug 31, 2004
13
0
0
US
I am making an Excel workbook that is used to compile information from other worksheets. There is a macro that pulls the info from these other files and pastes it into the main file. Right now there is just a hard path to the file that the information is pulled from. It works fine as long as that file and my main file stay where they are at right now. I work at a holding company of many banks. This workbook will be used by all our branches. There will be a chance that not all of them will have the files in the same locations on their networks. Basically what I am looking for (and have been looking everywhere for) is some way to maybe search for the file with the information then open it an take the info from it. Is there a way to search either an entire drive, or possibly a sub directory? I think there might be a way to do this, but my knowledge of VB is not that extensive.

Thanks for your help.
 
Take a look at the FileSystemObject. It is part of the Scripting Runtime library (scrrun.dll) and exposes Drives, Folders and Files collections you can iterate. I believe there is also a find method which may also be useful to you.

Have a great day!

j2consulting@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top