Specific File Search VBA script

dcharland

New Member
Joined
Mar 2, 2011
Messages
40
I need to help with a VBA Script...I've spent multiple hours reading the posts and trying them, but none actually worked or if they did I didn't know how to make them work!! I've create a few scripts but looping through directories will be a first for me :eeek:

I would like to have a script that will use a base path E.i C:\temp\ and them read cell A1 for a subfolder name e.i. dir1 now within this dir1 there are multiple directories and I want to code to look through all of them for files that match the following criteria. (first character a number, second a letter and third a number, then 4 more characters or letters and finishes in .csv) once the criterias are matched then append the path and file name to column C. I have the script that will open the file and copy paste the info I need.

The idea of the script is that there are new files created every day and I want to be able to track the history of which files were imported into the master so that I don't need to re-import them all each day! As there could be a few hundred of them and it would take a long time to run the script.

Hope that makes sense? Any guidance is highly appreciated.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Hi,

My Article here, "Produce an Excel list of the attributes of all MP3 files that sit in or below the "My Music" folder." http://www.experts-exchange.com/A_2839.html

It provides a recursive directory search, along with the use of Dir to only pull MP3 files

I'm tied up at present, let me know if you can adapt this to your needs, if not I will look at it in more detail when I can

Cheers

Dave
 
Upvote 0

Forum statistics

Threads
1,224,582
Messages
6,179,670
Members
452,936
Latest member
anamikabhargaw

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