Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default How to get the folder name of thisworkbook

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default How to get the folder name of thisworkbook

Thanks Bob,

You help me exactly what i wanted, really appreciated





"Bob Phillips" wrote:

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.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove end folder from path found with ThisWorkbook.Path command ? dim Excel Programming 9 April 23rd 08 06:04 AM
Save file in a new folder, but create folder only if folder doesn't already exist? nbaj2k[_40_] Excel Programming 6 August 11th 06 08:41 PM
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? Raven Excel Discussion (Misc queries) 1 January 24th 06 03:28 PM
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? Raven[_2_] Excel Programming 1 January 24th 06 04:23 AM


All times are GMT +1. The time now is 10:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"