Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 324
Default Separating Location and Filename in a cell

I have a long list of Files which include the complete path. I need tro
separate the filename ("JohnDoe.xls") from the first part of the cell
("C:\Files\Clients\"). In some cells the path includes numerous subfolders
so the formula needs to take that into consideration.

I have seen workable formulas in this site but cannot, for the life of me,
find them now. Any and all help is greatly appreciated.
--
Best wishes,

Jim
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Separating Location and Filename in a cell

One that I save <bg:

=MID(A1,1,LEN(A1)-FIND(CHAR(1),SUBSTITUTE(A1,"\",CHAR(1),LEN(A1)
-LEN(SUBSTITUTE(A1,"\","")))))



Jim Jackson wrote:

I have a long list of Files which include the complete path. I need tro
separate the filename ("JohnDoe.xls") from the first part of the cell
("C:\Files\Clients\"). In some cells the path includes numerous subfolders
so the formula needs to take that into consideration.

I have seen workable formulas in this site but cannot, for the life of me,
find them now. Any and all help is greatly appreciated.
--
Best wishes,

Jim


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 324
Default Separating Location and Filename in a cell

Don and Dave,

Thanks very much. You gave me both a formula I could make just a little
change to and a bit of code I could interject into a macro I am building. It
always helps to have a choice in such matters.
--
Best wishes,

Jim


"Don Guillett" wrote:

Sub getfilename()
For Each c In Selection
x = InStrRev(c, "\")
c.Offset(, 1) = Left(c, x)
c.Offset(, 2) = Right(c, Len(c) - x)
Next
End Sub

--
Don Guillett
SalesAid Software

"Jim Jackson" wrote in message
...
I have a long list of Files which include the complete path. I need tro
separate the filename ("JohnDoe.xls") from the first part of the cell
("C:\Files\Clients\"). In some cells the path includes numerous
subfolders
so the formula needs to take that into consideration.

I have seen workable formulas in this site but cannot, for the life of me,
find them now. Any and all help is greatly appreciated.
--
Best wishes,

Jim




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
How to make an external link to a filename defined by a cell value AndreCanelas Links and Linking in Excel 3 May 17th 06 11:38 PM
Worksheet tab in cell Davey Excel Discussion (Misc queries) 3 March 22nd 06 04:32 AM
Put Filename Variable in Macro David Excel Discussion (Misc queries) 4 December 27th 05 06:27 PM
cell filename Carina Excel Discussion (Misc queries) 1 November 3rd 05 01:37 PM
Hyperlink more than one cell at a time? beginnerExceluser New Users to Excel 9 October 17th 05 05:01 PM


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