Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Return Filename

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jarle - 03 Mar 2008 21:01 GMT
I have the string that includes path and filename:

C:\Documents and Settings\Folder1\Folder2\....\filename

How can I easily load only the filename to the variable f_name?

rgds
Jarle
IanKR - 03 Mar 2008 21:25 GMT
>I have the string that includes path and filename:
>
> C:\Documents and Settings\Folder1\Folder2\....\filename
>
> How can I easily load only the filename to the variable f_name?

What you've got there is ThisWorkbook.FullName. To get just the file name
use ThisWorkbook.Name and assign that to f_name.
Bob Phillips - 03 Mar 2008 21:36 GMT
If you need to parse it, look at InstrRev in VBA help.

Signature

---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

>I have the string that includes path and filename:
>
[quoted text clipped - 4 lines]
> rgds
> Jarle
Jarle - 04 Mar 2008 07:45 GMT
I did it like this:

s = "C:\Documents and Settings\folder1\folder2\bok2.xls"
s1 = Split(s, "\")
f_name = s1(UBound(s1))

Jarle skrev:

> I have the string that includes path and filename:
>
[quoted text clipped - 4 lines]
> rgds
> Jarle
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.