I wish to sort a wide range of files based on the name after the final "_" into folders with the same name using VBA. As an example I have the following files;
XYZ_Featurepoint_A_ABCD.dwg
XYZ_Featurepoint_A_ABCD.dwg.xml
XYZ_A_ABCD.dwg
XYZ_A_ABCD.dwg.xml
XYZ_Featurepoint_A_ABCDE.dwg
XYZ_Featurepoint_A_ABCDE.dwg.xml
XYZ_A_ABCDE.dwg
XYZ_A_ABCDE.dwg.xml
I want the script to first create folders based on the filename if a range of files in a folder based on whatever is after the last _, in this case ABCD and ABCDE. Then I want it to put the files with the same filename after the last _ which in this case is ABCD and ABCDE into the corresponding folders named the same (ABCD and ABCDE)
Please advise
Bookmarks