Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Return file from a path string

If you have xl2000 or later:

sStr = "C:\folder1\folder2\folder3\folder4\folder5\file.x ls"
? Right(sStr,len(sStr)-instrrev(sStr,"\"))
file.xls

demo's from the immediate window.

--
Regards,
Tom Ogilvy

"Steph" wrote in message
...
I have a string variable that is a path to a file:
C:\folder1\folder2\folder3\folder4\folder5\file.xl s

How can I create a new variable that is simply the file name.xls? Thanks!




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Return file from a path string

Thank you so much

"Tom Ogilvy" wrote in message
...
If you have xl2000 or later:

sStr = "C:\folder1\folder2\folder3\folder4\folder5\file.x ls"
? Right(sStr,len(sStr)-instrrev(sStr,"\"))
file.xls

demo's from the immediate window.

--
Regards,
Tom Ogilvy

"Steph" wrote in message
...
I have a string variable that is a path to a file:
C:\folder1\folder2\folder3\folder4\folder5\file.xl s

How can I create a new variable that is simply the file name.xls?

Thanks!






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
Concatenate path and file string for external reference Michael[_4_] Excel Worksheet Functions 5 May 21st 23 11:44 AM
How to extract only file name from folder path string in Excel? JayKay Excel Worksheet Functions 1 March 20th 09 04:57 PM
Recursive Function + File searching to return path ph8[_6_] Excel Programming 24 October 14th 05 08:45 AM
Stripping Path from File String Nigel[_6_] Excel Programming 15 February 26th 04 06:35 AM
Using a variable string in a file save path Ron[_13_] Excel Programming 1 October 16th 03 08:29 PM


All times are GMT +1. The time now is 10:03 AM.

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"