Macro to copy files in specific directories

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,561
Office Version
  1. 2021
Platform
  1. Windows
I download several csv files each month and then import these into excel. These files reside in a directory called "CSPAYPAC"


I would like a macro to copy these files as follows into the following directories before importing these



1) The files starting with an E eg EDTXRCM.csv must be copied into directory East
2) The files starting with an N eg NETXCRM.csv must be copied into directory North
3) The files starting with an R eg RMTXCRM.csv must be copied into directory Rand
4) The files starting with D eg DMTXCRM.csv must be copied into directory Deep


Your assistance in this regard is most appreciated
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
are these single files or you want to copy all files starting with E,n,R etc. from this directory?
 
Upvote 0
Thanks for the reply

Under directory CSPAYPAC, one could have multiple files start with an E, N, R Etc that needs to be copied into the repective folder
 
Upvote 0

Forum statistics

Threads
1,214,805
Messages
6,121,656
Members
449,045
Latest member
Marcus05

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