get folder name

  • Thread starter Thread starter AD108
  • Start date Start date
A

AD108

What would be the most direct approach to extracting just the last folder
name from "ThisWorkBook.Path".
 
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).
 
arrPath = Split(ThisWorkbook.Path, "\")
strParentFldr = arrPath(UBound(arrPath))


Steve
 
Thanks,


Dave Peterson said:
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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top