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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looping around files in a windows folder

Status
Not open for further replies.

mozgheib

Programmer
Dec 14, 2003
50
KW
Hello,

I have a windows folder with many csv files. Now I would like to import all these csv files into sql in vba apply some logic and spit out one consolidated file.

WHat I would like to know how can I write code to go into the folder and loop around all the files in order to make the file name i am importing a variable?

Please advise.
Thanks.
 
Look up the FileSystemObject and related classes in The Microsoft Scripting Runtime reference.
 
Or simply take a look at the VBA Dir function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top