View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default How do I display the filename and path in a cell?

You need to include a cell reference (any cell reference):
CELL("filename"),A1)


Using the correct syntax would help!

CELL("filename",A1)


--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
=LEFT(CELL("filename"),FIND("[",CELL("filename"))-1)&MID(CELL("filename"),FIND("[",CELL("filename"))+1,FIND("]",CELL("filename"))-FIND("[",CELL("filename"))-1)

=SUBSTITUTE(LEFT(CELL("filename"),FIND("]",CELL("filename"))-1),"[",)

These formulas could return an incorrect result if you have more than one
file open at the same time. You need to include a cell reference (any cell
reference):

CELL("filename"),A1)

--
Biff
Microsoft Excel MVP


"Jacob Skaria" wrote in message
...
Is the cell formatted to text..

=SUBSTITUTE(LEFT(CELL("filename"),FIND("]",CELL("filename"))-1),"[",)

If this post helps click Yes
---------------
Jacob Skaria


"DianePDavies" wrote:

It doesn't work...

If I paste the suggestion into my cell - then that is just what is
diplayed.

Same for the suggestion by NBVC.

So I am propably doing something wrong: I mark the cell and paste e.g.
=CELL("filename",$A$1)
in that cell. I can see that CELL is a function - but somehow it is not
recognized by my sheet? What do I have to set to activate this function?
--
Diane


"Jacob Skaria" wrote:

Try the below in a saved workbook.

(all in one line)
=LEFT(CELL("filename"),FIND("[",CELL("filename"))-1)&MID(CELL("filename"),FIND("[",CELL("filename"))+1,FIND("]",CELL("filename"))-FIND("[",CELL("filename"))-1)

If this post helps click Yes
---------------
Jacob Skaria


"DianePDavies" wrote:

How do I display the filename and path in a cell? I dont want it in
the
header - but I want it in a cell as I want to link to that cell from
a word
document.
--
Diane