Move files into folders using Excel

August 7, 2011 at 09:27:22
Specs: Windows 7
Hi, I have 3000 files in 3 folders and I need to first move them out of the 3 folders and into 1000 folders with the same name as the filename (there are 3 photos with the same file name e.g. 35009200(1), 35009200 (2) and 35009200 =(3). Then I need to move the newly created folders into 10 new folders. I have an excel file which has a column with the file name and a column with the folder which it should go into which looks like this:

Filename Foldername
35009200 UK
35000160 Norway
35000080 France
35000070 Italy
35000660 Norway
35002800 Italy

The idea is that I end up with 10 country folders each with approx. 100 sub folders each of which contain 3 files. Can anyone help me to write a script so that I can move all the files into the correct folders


See More: Move files into folders using Excel

Report •


#1
August 7, 2011 at 11:14:48
Before we can work on any code, I need a further explanation of many things about your post.

In your text, you showed 3 "formats" of file names:

35009200(1) - a number followed by a digit in parentheses.

35009200 (2) - a number followed by a space and then a digit in parentheses.

35009200 =(3) - a number followed by a space and then an equal sign and then a digit in parentheses.

Is this really what you have?

re: "there are 3 photos with the same file name e.g...."

As I'm sure you are aware, the three names listed above are not the same. They're similar, but they are not the same.

re: "I have 3000 files in 3 folders "

Are the files with the "same" names split evenly across all three folders (i.e. 1 file of each name in each of the 3 folders) or are they all mixed up across the 3 folders?

Are the 3 files with "same" name the same picture? Are you trying to reduce this down to 1000 pictures, eliminating the duplicates or are there actually 3000 different photos?

Can all of the photos be manually moved into 1 folder, just to make the coding easier?

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •
Related Solutions


Ask Question