Good morning all,
Hopefully my question title was not too vague, however please let me explain the issue in more detail...
I have two directories, both with many subfolders, with each of these subfolders being assigned a unique ID reference number and containing an Excel file with the same corresponding ID number. Some of the Excel files do not belong to a subfolder and are placed directly into the parent folder. To clarify, please find an example below;
Main (Parent) Folders ---- Subfolder ---- File(s)
Finance ---- 5000 ---- 5000 - Financev1.xlsx
Management ---- 5001 ---- 5001 - Mangementv1.xlsx
Customer Service ---- 5002 ---- 5002 - CustServicev1.xlsx
Example path: C:\My Documents\Finance\5000\5000-Financev1.xlsx
To make matters more confusing, many of these type of files are on another drive (Z:\) and have been incorrectly named/filed (although generally always including their respective 4 digit ID reference in the title) and therefore the search must sometimes only look up a portion of the filename.
I have unfortunately been tasked with copying all of the folders containing the Excel files from Z:\ to C:\ while keeping all of the files contained in each folder.
The folders containing the Excel files already exist on the Z:\ drive while an empty folder of the same name already exists on the C:\ drive - the lookup must therefore look through all of the folders on the Z:\ drive and, if the folder/file matches the corresponding folder name on the C:\ drive, then make a copy of it while keeping any subfolders/files in place. It should also preferably not delete, overwrite or remove any files.
If anyone could help me out with this, I'd be extremely grateful. I'm very new to VBA and have done many searches on the internet for what I am looking for, but unfortunately have been unable to successfully implement any of the codes I have found. If anyone requires additional clarification on any of the above, please let me know and I will try to provide a clear explanation.
Thank you all in advance.
Tom
Bookmarks