ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   get folder name (https://www.excelbanter.com/excel-programming/368743-get-folder-name.html)

AD108

get folder name
 
What would be the most direct approach to extracting just the last folder
name from "ThisWorkBook.Path".




Dave Peterson

get folder name
 
Using InStrRev if you're using xl2k or above.

Or looping from the last character to the first looking for the path separator
(\ on windows).

AD108 wrote:

What would be the most direct approach to extracting just the last folder
name from "ThisWorkBook.Path".


--

Dave Peterson

Steve Yandl

get folder name
 
arrPath = Split(ThisWorkbook.Path, "\")
strParentFldr = arrPath(UBound(arrPath))


Steve



"AD108" wrote in message
...
What would be the most direct approach to extracting just the last folder
name from "ThisWorkBook.Path".






AD108

get folder name
 
Thanks,


"Dave Peterson" wrote in message
...
Using InStrRev if you're using xl2k or above.

Or looping from the last character to the first looking for the path

separator
(\ on windows).

AD108 wrote:

What would be the most direct approach to extracting just the last

folder
name from "ThisWorkBook.Path".


--

Dave Peterson





All times are GMT +1. The time now is 12:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com