I need a variable to return the name of the folder the open workbook is in.
I tried the following 2 but they are not what I need.
This one results in Y:\AAL\+Templates
This one results in Y:\AAL\+Templates\TO TEMPLATE_NEW.xlsm
The result i need is just...
+Templates
None of the folders before it. The reason for this is that I am have a code that does a saveas and names the file. I need the name of the file to start with the name of the folder it is inside of.
In this case....
+TemplatesQuote.xlsx
I tried the following 2 but they are not what I need.
This one results in Y:\AAL\+Templates
Code:
Dim MyPath As String
MyPath = ActiveWorkbook.Path
This one results in Y:\AAL\+Templates\TO TEMPLATE_NEW.xlsm
Code:
Dim MyCompletePath As String
MyCompletePath = ActiveWorkbook.FullName
The result i need is just...
+Templates
None of the folders before it. The reason for this is that I am have a code that does a saveas and names the file. I need the name of the file to start with the name of the folder it is inside of.
In this case....
+TemplatesQuote.xlsx
Last edited: