Hi everyone.
I’m looking for an Excel VBA to insert the subfolder name and one folder before that (parent folder) in separate cells such as A1 and A2.
Example:
I have saved Book1.xlsm in the following directory:
C:\Users\Matthew\Downloads\F23343\29035020\Book1.xlsm
** Important**: The directory path (last two folders names) would be changed for each Excel sheet. For example, new Excel sheet could be saved in a different directory such as C:\Users\Matthew\Downloads\Z0253343\27654020\Book1.xlsm
So, the code shouldn’t only rely on these names and directory.
In this case, I need the VBA code to insert 29035020 and F23343 names into two separate cells. Also, for the F23343, is there any way to exclude the letter F and only insert 23343?
Your help is highly appreciated. Thanks
I’m looking for an Excel VBA to insert the subfolder name and one folder before that (parent folder) in separate cells such as A1 and A2.
Example:
I have saved Book1.xlsm in the following directory:
C:\Users\Matthew\Downloads\F23343\29035020\Book1.xlsm
** Important**: The directory path (last two folders names) would be changed for each Excel sheet. For example, new Excel sheet could be saved in a different directory such as C:\Users\Matthew\Downloads\Z0253343\27654020\Book1.xlsm
So, the code shouldn’t only rely on these names and directory.
In this case, I need the VBA code to insert 29035020 and F23343 names into two separate cells. Also, for the F23343, is there any way to exclude the letter F and only insert 23343?
Your help is highly appreciated. Thanks