Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default How do I display the filename and path in a cell?

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default How do I display the filename and path in a cell?

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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How do I display the filename and path in a cell?


Try:

=CELL("filename",$A$1)

this gives the entire path (including the sheetname).


--
NBVC

Where there is a will there are many ways.
'The Code Cage' (http;//www.thecodecage.com)
------------------------------------------------------------------------
NBVC's Profile: http://www.thecodecage.com/forumz/member.php?userid=74
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=111336

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default How do I display the filename and path in a cell?

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

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How do I display the filename and path in a cell?

Format the cell as General (or anything but Text).

Then reenter the formula.

The workbook has to be saved at least once for this to work, too.

If that doesn't help, maybe you're looking at formulas.

In xl2003 menus:
Tools|Options|View Tab|Uncheck Formulas

In any version:
ctrl-` (control-backquote, the key to the left of the 1/! on my USA keyboard).

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


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default How do I display the filename and path in a cell?

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

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default How do I display the filename and path in a cell?

=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



  #8   Report Post  
Posted to microsoft.public.excel.misc
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





  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default How do I display the filename and path in a cell?

Problem solved!

It appears that if I select a cell and paste the code in - then it doesn't
work. But if I manually type the same code:

=CELL("filename")

then it works and shows the path, the file and the current sheet. I have to
work on the formatting of the actual file name - but that can be solved.

--
Diane


"T. Valko" wrote:

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






  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How do I display the filename and path in a cell?

Read Biff's message again.

You'll want to use:

=cell("Filename",a1)

Otherwise, you may find that the value isn't what you expect--you'll see the
file and sheet name that was active when excel last calculated.

DianePDavies wrote:

Problem solved!

It appears that if I select a cell and paste the code in - then it doesn't
work. But if I manually type the same code:

=CELL("filename")

then it works and shows the path, the file and the current sheet. I have to
work on the formatting of the actual file name - but that can be solved.

--
Diane

"T. Valko" wrote:

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






--

Dave Peterson
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
Freeze filename and path in cell Constantly Questioning Excel Discussion (Misc queries) 2 October 29th 08 06:48 PM
how to insert the path and filename into cell in excel 2002 fuzzylinux Excel Discussion (Misc queries) 2 June 4th 08 09:24 PM
showing path and filename Annie Excel Worksheet Functions 1 February 9th 07 01:34 PM
How do i display the Filename without the path? robert_manic Excel Discussion (Misc queries) 3 October 11th 06 05:47 PM
Display filename in cell Jeff Excel Discussion (Misc queries) 2 September 13th 06 04:34 PM


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