Copy files to a new folder using VBA

imaguy77

New Member
Joined
Aug 26, 2008
Messages
21
Hi all,

I have a VBA question for you all which would be hugely helpful if i could get working:

I have 2 columns: Column A has a new folder name that I'd like created
Column B has the first 6 characters of a filename.

I want to look in the main folder for files matching column B, and copy all files matching column B to the folder specified in column A as a subfolder of the main folder.

For example, column A would have 12 rows, 6 with Retail and 6 with Supply Chain. Column B would have 12 records each like D600666, D900999, etc. which specify departments.

Does this make sense? Any help is much appreciated!!


-Jeff
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,224,590
Messages
6,179,754
Members
452,940
Latest member
rootytrip

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