move file macro

daveofgv

New Member
Joined
Apr 8, 2011
Messages
30
I have a list of file names in column A (example: 54335343.tif)
I have one directory with about 40 or so subfolders where this image is located, however, I don't know which one unless I manually searched for it.

What I need is a macro to run where I can have a list of 200 or even 1000 file names (like the above example) and move only those file names to another folder. I don't want to move the whole directory - just the file names I have in the column.

I know how to move the whole directory and also file names, however, I only know how to hardcode the actual file path (which I don't know).

Anyone know how to have excel macro search for the file name in a directory and once it finds it that file will move to another given folder?

Also, I need another column to put a "1" or something next to the image that the move method cannot find.

Maybe also move the file name to another column instead of a "1".....

Is this possible and if so can anyone help me?

We are hiring temp workers at work so I need to make this simple for those that don't know computers that well....

Thanks in advanced

daveofgv
 
I let the process run at night and this morning it worked. I guess since there are so many files and so many folders to search thru it says not reponding cause its running in the background. Also maybe cause its on network drives.

Thank you for your help and expertise.

Daveofgv
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
I let the process run at night and this morning it worked. I guess since there are so many files and so many folders to search thru it says not reponding cause its running in the background.

Wow, that's a lot of processing time. :)

Also maybe cause its on network drives.

I can't give you a definitive answer, but it could very well be the case.

Thank you for your help and expertise.

You're very welcome! Thanks for the feedback!
 
Upvote 0
Great script! I have one question - if a file exists within a source subdirectory but does not exist in the destination directory, how can I copy that subdirectory into the destination as well?
 
Upvote 0
Hello,

Wondering if there are files found within the subdirectories in the source folder, if there is a way to copy the subdirectory into the destination folder?

Much appreciated!
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,666
Members
448,977
Latest member
moonlight6

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