Good afternoon All!
I am working on a macro that looks at a SharePoint site for files in a folder. The idea is to retrieve the last created date for each file category within a certain naming convention. I'd like to split the file name into two parts based on the 3rd delimiter. Create the dictionary and eventually loop through all the file names to see which ones inside the folder are the last created date.
Here are my steps I'm trying to create within this macro
1. Replace format with switch to know which folder to look into [DONE]
2. Find active workbook's path [DONE]
3. Map to temporary drive [DONE]
4. Loop through all files and return latest created date per category
5. Open last created date and copy worksheets("Summary") and paste into this workbook under new name by second delimiter, ie, MS or Compensation
Example files for step 4 looks like this:
Z:\2019_January
GM1_PL1_Compensation_January_2019_01.xlsb
GM1_PL1_Compensation_January_2019_02.xlsb
NAL_WL_MS_January_2019_01.xlsb
NAL_WL_MS_January_2019_02.xlsb
Example harvest would look like this:
GM1_PL1_Compensation
NAL_WL_MS
And finally, getting the latest created by date for each category:
GM1_PL1_Compensation_January_2019_01.xlsb
GM1_PL1_Compensation_January_2019_02.xlsb [LATEST FILE]
NAL_WL_MS_January_2019_01.xlsb
NAL_WL_MS_January_2019_02.xlsb [LATEST FILE]
Here's my current code so far:
Help would be greatly appreciated!
Bookmarks