Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Separating Location and Filename in a cell
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 |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to make an external link to a filename defined by a cell value | Links and Linking in Excel | |||
Worksheet tab in cell | Excel Discussion (Misc queries) | |||
Put Filename Variable in Macro | Excel Discussion (Misc queries) | |||
cell filename | Excel Discussion (Misc queries) | |||
Hyperlink more than one cell at a time? | New Users to Excel |