Excel pulling data from files

psnewjen

New Member
Joined
Sep 16, 2014
Messages
1
I have an Excel workbook that acts like a log of Excel reports that are generated and stored in a specified folder. I would like this workbook, upon opening, to pull data from various cells from all of the files in the folder, preferably without opening the source files. I don't want to tell the code what files to pull from. I would like it to pull from all in the folder, as there are new files generated often. I am new to VBA and trying to bite off more than I can chew. Does anybody know the code for doing this? Thanks :)
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Use a Dir function loop to loop through Excel files in the folder. Call Workbooks.Open inside the loop to open each file and import/copy data. Or if you don't want to open the source files use a database query (ODBC or OLEDB connection) in the loop (more complicated and less flexible). Either way, record a macro to get the starting code.
 
Upvote 0

Forum statistics

Threads
1,222,405
Messages
6,165,867
Members
451,989
Latest member
DannyBoy1977

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top