View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Formula to find filename

=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND("]",CELL("filename",A1))-FIND("[",CELL("filename",A1))-1)

--
Gary''s Student - gsnu200735


"Kevin" wrote:

Hi

I have a written the file path of File A in a cell of another spreadsheet,
say File B. The file path would be written as below
C:\MY Files\Media\Test.doc

I need a excel cell formula which can return the name of the
file (ie "Test.doc") no matter how many directories or the lenght of the
address. Note Cell("filename",a1) does not help me because this returns the
path of the existing spredsheet. Seems I need a way to find where the last
"\" is in the file path

any ideas

thanks
--
Kevin