View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_3_] Bob Phillips[_3_] is offline
external usenet poster
 
Posts: 2,420
Default How to get the folder name of thisworkbook

Dim Foldername As String

With ThisWorkbook

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

MsgBox Foldername
End With


--
__________________________________
HTH

Bob

"Edward" wrote in message
...
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.