The Code Cage - Microsoft Office help Free Microsoft Office Help for all Applications!  

To stop seeing these ads and get other benefits check This page!

Go Back   The Code Cage Forums > Newsgroups - Microsoft Topics > Newsgroup - Excel Forum > Excel Miscellaneous


Excel Miscellaneous Post questions in this forum if they are related to using Microsoft Excel that doesn't quite fit in any other category e.g quirks, Formulae or built in functionality etc.

Closed Thread
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 30th June 2009, 02:08 PM
DianePDavies
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Default [SOLVED]: How do I display the filename and path in a cell?

------ Register to get rid of these "In Post" ads! ------


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


Did you find this post helpful? Yes | No
The Code Cage Advertisment
Advertisement

To stop seeing these ads and get other benefits check This page!
  #2 (permalink)  
Old 30th June 2009, 02:14 PM
Jacob Skaria
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Default RE: How do I display the filename and path in a cell?

------ Register to get rid of these "In Post" ads! ------


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



Did you find this post helpful? Yes | No
  #3 (permalink)  
Old 30th June 2009, 02:15 PM
NBVC's Avatar
The Code Cage Staff
MS Office Version: MS Office 2003, 2007
MS Office Skill Level: Proficient with Excel


My Top Tip Count: 2

 
Join Date: Dec 2008
Location: Mississauga Canada
Posts: 396
Thanks to others: 3
Thanked 14 Times in 14 Posts
Rep Power: 6
NBVC has a spectacular aura aboutNBVC has a spectacular aura about
2 Top Tips
Canada
Default Re: How do I display the filename and path in a cell?

------ Register to get rid of these "In Post" ads! ------


Try:

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

this gives the entire path (including the sheetname).
__________________
Where there is a will there are many ways.

The Code Cage


Did you find this post helpful? Yes | No
The Code Cage Advertisment
Advertisement

To stop seeing these ads and get other benefits check This page!
  #4 (permalink)  
Old 30th June 2009, 03:30 PM
DianePDavies
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Default RE: How do I display the filename and path in a cell?

------ Register to get rid of these "In Post" ads! ------


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



Did you find this post helpful? Yes | No
  #5 (permalink)  
Old 30th June 2009, 03:50 PM
Dave Peterson
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Default Re: How do I display the filename and path in a cell?

------ Register to get rid of these "In Post" ads! ------


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


Did you find this post helpful? Yes | No
  #6 (permalink)  
Old 30th June 2009, 03:50 PM
Jacob Skaria
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Default RE: How do I display the filename and path in a cell?

------ Register to get rid of these "In Post" ads! ------


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



Did you find this post helpful? Yes | No
The Code Cage Advertisment
Advertisement

To stop seeing these ads and get other benefits check This page!
  #7 (permalink)  
Old 30th June 2009, 06:23 PM
T. Valko
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Default Re: How do I display the filename and path in a cell?

------ Register to get rid of these "In Post" ads! ------


=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" <JacobSkaria@discussions.microsoft.com> wrote in message
news:B243C918-E14B-4BE4-9D22-A56B9364C7E3@microsoft.com...
> 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





Did you find this post helpful? Yes | No
  #8 (permalink)  
Old 30th June 2009, 06:29 PM
T. Valko
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Default Re: How do I display the filename and path in a cell?

------ Register to get rid of these "In Post" ads! ------


>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" <biffinpitt@comcast.net> wrote in message
news:eROjdca%23JHA.5092@TK2MSFTNGP03.phx.gbl...
> =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" <JacobSkaria@discussions.microsoft.com> wrote in message
> news:B243C918-E14B-4BE4-9D22-A56B9364C7E3@microsoft.com...
>> 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

>
>





Did you find this post helpful? Yes | No
  #9 (permalink)  
Old 30th June 2009, 08:26 PM
DianePDavies
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Default Re: How do I display the filename and path in a cell?

------ Register to get rid of these "In Post" ads! ------


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" <biffinpitt@comcast.net> wrote in message
> news:eROjdca%23JHA.5092@TK2MSFTNGP03.phx.gbl...
> > =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" <JacobSkaria@discussions.microsoft.com> wrote in message
> > news:B243C918-E14B-4BE4-9D22-A56B9364C7E3@microsoft.com...
> >> 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

> >
> >

>
>
>



Did you find this post helpful? Yes | No
The Code Cage Advertisment
Advertisement

To stop seeing these ads and get other benefits check This page!
  #10 (permalink)  
Old 30th June 2009, 09:38 PM
Dave Peterson
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Default Re: How do I display the filename and path in a cell?

------ Register to get rid of these "In Post" ads! ------


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" <biffinpitt@comcast.net> wrote in message
> > news:eROjdca%23JHA.5092@TK2MSFTNGP03.phx.gbl...
> > > =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" <JacobSkaria@discussions.microsoft.com> wrote in message
> > > news:B243C918-E14B-4BE4-9D22-A56B9364C7E3@microsoft.com...
> > >> 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


Did you find this post helpful? Yes | No
The Code Cage Advertisment
Advertisement

To stop seeing these ads and get other benefits check This page!
Closed Thread

Bookmarks

Tags
cell, display, filename, path

New topics in Excel Miscellaneous


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

The Code Cage Affilliates


To stop seeing these ads and get other benefits check This page!



All times are GMT +1. The time now is 12:32 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2
No part of this board may be copied or reproduced either in part or full without the express permission of The Code Cage Team.
We are not associated with nor employed by Microsoft in any way, we simply provide resources!
All MS office icons are registered trademarks of the application the represent