VBA to open up folders on drive

CodyMonster

Board Regular
Joined
Sep 28, 2009
Messages
159
I looked around a bit and I haven't really been able to find what I'm looking for.

Is there a way to have VBA loop through files on a drive to retrieve other excel workbooks?
But, without having to use the file picker? I have over 100 file folders I need to go into. And I have multiple files inside each file folder.
Each folder is labeled differently with the exception of a number at the beginning of the folder. Each workbook in the file is named differently as well.

Example.
In C:\work\stuff
I have over 100 file folders
C:\work\stuff\1_xxx
Inside folder 1_xxx
theui.xls
fjdkl.xls
ueiop.xls
C:\work\stuff\2_xxx
Inside folder 2_xxx
riep.xls
bnkld.xls
ueiow.xls

on and on until the folder reaches 120.. etc.

I'm trying to avoid doing anything manual. So popup file section would not be ideal.
If anyone has an example I could work from I would greatly appreciate it!

Cody
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,215,756
Messages
6,126,692
Members
449,330
Latest member
ThatGuyCap

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