How to get the folder name of thisworkbook

E

Edward

Hi,

I need some help,
How do i get the name of the folder where my .xls contain
i do not need the whole path just the folder where this active .xls is in.

file will be save in different folder, therefore i need the macro to just
get the direct folder of where this .xls is in.
 
B

Bob Phillips

Dim Foldername As String

With ThisWorkbook

Foldername = Right$(.Path, Len(.Path) - InStrRev(.Path,
Application.PathSeparator))

MsgBox Foldername
End With
 

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

Top