PDA

View Full Version : Need Help Searching Folder/SubFolder, then Copying to different Folder



AFerg85
04-10-2012, 08:29 AM
I have searched for my answer, looked at little pieces here and there, but haven't hit the nail on the head.

Everyday we have 4 files (2 AM, and 2 PM), both divided into two different work locations. We need to archive those 4 files into our workgroups local drive. Now each day the filename contains that days date. So for today AM we have: Time Exception A 4-7-2012 and Time Exception B 4-7-2012, and PM we have Time Exception A 4-7-2012 and Time Exception B 4-7-2012. All four files are located in different folders. Folder paths:

AM:
Time Exception A 4-7-2012:
S:\ABCSharedFolders\OOC\spOvA\ES\ABC\PSD\AM Time Exception\PP #7\

Time Exception B 4-7-2012:
S:\ABCSharedFolder\OOC\spOvA\ES\ABC\BSD\AM FILES\AM Time Exception\PP-07\

PM:
Time Exception A 4-7-2012
S:\ABCSharedFolders\OOC\spOvA\ES\ABC\PSD\PM Time Exception\PP 7-12\

Time Exception B 4-7-2012
S:\ABCSharedFolders\OOC\spOvA\ES\ABC\BSD\PM FILES\PM Time Exceptions\PP #07 - 2012\

One problem that we run into as you can see is that the consistancy is lost when these workgroups name their folders. That is why having some code that will search the subdirectories is critical since we do have consistancy all the way up to PSD and BSD folders.

Once we can confirm that the file exists, it will have to be copied and pasted to our workgroups folder. The path for this is:

AM:
Time Exception A 4-7-2012:
Z:\ABC\ABC Field\COSA\Time Exception Archive\2012 Archive\A\April\AM\

Time Exception B 4-7-2012:
Z:\ABC\ABC Field\COSA\Time Exception Archive\2012 Archive\B\April\AM\

PM:
Time Exception A 4-7-2012
Z:\ABC\ABC Field\COSA\Time Exception Archive\2012 Archive\A\April\PM\

Time Exception B 4-7-2012
Z:\ABC\ABC Field\COSA\Time Exception Archive\2012 Archive\B\April\PM\

If possible, we would like the "user input" or search function to only look for the date in the filename just in case someone gets the need to save the file with a funky name, at least we know the date will always be there.

The files to be copied are word document files, either .doc or .docx. We are applying this macro to our Excel Spreadsheet though.

Thanks for all the help you can provide.

AFerg85
04-10-2012, 04:04 PM
I see quite a few looking but no replies yet. Is there any more information that I could provide that would make things easier?

AFerg85
04-11-2012, 06:59 PM
Anybody.........