+ Reply to Thread
Results 1 to 5 of 5

I want a cell to show the current filename automatically.

  1. #1
    Troy
    Guest

    I want a cell to show the current filename automatically.

    I am trying to set up a spreadsheet for work. I want a specified cell to
    automatically show the filename of the current file.

  2. #2
    Valued Forum Contributor
    Join Date
    03-25-2004
    Location
    Boston, MA US
    Posts
    1,094
    Troy,

    In the cell that you want the filename to appear.

    =CELL("filename",A1)

    Reference can be any cell in the workbook. It will show the full path and sheet like.

    C:\Documents and Settings\doeJ\My Documents\[Filename.xls]Sheet1


    HTH

    Steve

  3. #3
    Gary''s Student
    Guest

    RE: I want a cell to show the current filename automatically.

    =CELL("filename",B1) in B1. Will display path as well as filename
    --
    Gary''s Student


    "Troy" wrote:

    > I am trying to set up a spreadsheet for work. I want a specified cell to
    > automatically show the filename of the current file.


  4. #4
    Troy
    Guest

    Re: I want a cell to show the current filename automatically.

    But what if I want only the file anme to show and not the entire path? Also,
    what exactly goes in the cell? I am looking at your post and not sure how to
    insert the information.

    "SteveG" wrote:

    >
    > Troy,
    >
    > In the cell that you want the filename to appear.
    >
    > =CELL("filename",A1)
    >
    > Reference can be any cell in the workbook. It will show the full path
    > and sheet like.
    >
    > C:\Documents and Settings\doeJ\My Documents\[Filename.xls]Sheet1
    >
    >
    > HTH
    >
    > Steve
    >
    >
    > --
    > SteveG
    > ------------------------------------------------------------------------
    > SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
    > View this thread: http://www.excelforum.com/showthread...hreadid=506751
    >
    >


  5. #5
    Sloth
    Guest

    Re: I want a cell to show the current filename automatically.

    You must save the file at least once before these formulas will work.

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

    returns name -without extension "Filename"

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

    returns name with extension "Filename.xls"


    "Troy" wrote:

    > But what if I want only the file anme to show and not the entire path? Also,
    > what exactly goes in the cell? I am looking at your post and not sure how to
    > insert the information.
    >
    > "SteveG" wrote:
    >
    > >
    > > Troy,
    > >
    > > In the cell that you want the filename to appear.
    > >
    > > =CELL("filename",A1)
    > >
    > > Reference can be any cell in the workbook. It will show the full path
    > > and sheet like.
    > >
    > > C:\Documents and Settings\doeJ\My Documents\[Filename.xls]Sheet1
    > >
    > >
    > > HTH
    > >
    > > Steve
    > >
    > >
    > > --
    > > SteveG
    > > ------------------------------------------------------------------------
    > > SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
    > > View this thread: http://www.excelforum.com/showthread...hreadid=506751
    > >
    > >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1