Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Return Filename

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Return Filename

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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Return Filename

If you need to parse it, look at InstrRev in VBA help.

--
---
HTH

Bob


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



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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Return Filename

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:

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

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

rgds
Jarle


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
return filename Joanne Excel Programming 5 July 27th 07 01:37 PM
SaveAs Filename:=filename, FileFormat:=xlCSV Teddy[_3_] Excel Programming 2 May 29th 07 02:34 PM
Converting a Variable Filename to a Constant Filename Magnivy Excel Programming 2 August 15th 06 06:13 PM
set filename to <filename-date on open bob engler Excel Worksheet Functions 2 July 13th 06 05:11 AM
Function to return filepath given full filename Matt Lawson[_3_] Excel Programming 8 March 3rd 04 02:32 AM


All times are GMT +1. The time now is 12:48 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"