Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2004
    Location
    Greenville, SC
    Posts
    271

    Unanswered: file path on sheet

    Is there a way to list the path of the current sheet in the footer or at the bottom of the page? ie: C:\MyDocuments\Company\Personnel\Employee.xls

    Thank You,
    Michael
    Gotta to do some code

  2. #2
    Join Date
    Oct 2003
    Posts
    1,091
    Of course, if you have XL2002 or XL2003 this is built in, so you don't need this code.

    Otherwise:
    Code:
    Sub CustomFooter()
    '   Inserts the file name and path into the page footer
    '   for each sheet in the active workbook
        Dim sht as Worksheet
        For Each sht In ActiveWorkbook.Sheets
            sht.PageSetup.LeftFooter = ActiveWorkbook.FullName
        Next sht
    End Sub
    Change the placement with: RightFooter or CenterFooter
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  3. #3
    Join Date
    Mar 2004
    Location
    Greenville, SC
    Posts
    271
    Thank you very much!

    Is there a way to enter this in a formula on the spread sheet?
    Gotta to do some code

  4. #4
    Join Date
    Oct 2003
    Posts
    1,091
    =SUBSTITUTE(LEFT(CELL("FileName",A1),FIND("]",CELL("FileName",A1))-1),"[","")



    ==============

    And if you want to play around:

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

    SHEETNAME: =RIGHT(CELL("FILENAME",A1),LEN(CELL("FILENAME",A1) )-FIND("]",CELL("FILENAME",A1)))
    Last edited by shades; 01-05-05 at 17:40.
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  5. #5
    Join Date
    Oct 2003
    Posts
    1,091
    If you have the Excel add-in (free!) called Morefunc.xll, you can do this more easily. And it has many other useful functions that Excel does not:

    morefunc
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  6. #6
    Join Date
    Mar 2004
    Location
    Greenville, SC
    Posts
    271
    Thank You very, very much shades (=substitute) is exactly what I needed.

    Michael
    Gotta to do some code

Posting Permissions

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