Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 7 of 7

Thread: Insert path name into footnote?

  1. #1
    New Member
    Join Date
    Feb 2002
    Posts
    40
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Help! My supervisor is used to Lotus and wants the location of the documents (eg. c:/blah/blahdeblah.xls) inserted into the footer. I know I've read something about this functionality on this site, but I can't track down the tip. Any ideas?

    Thanks,
    Lindsay

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Sydney, Australia
    Posts
    2,940
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default

    You can do this using a very small piece of VBA code. Right click the lower of the 2 Excel icons at the top left of the screen and choose View Code. Then paste this:-

    Code:
    Private Sub Workbook_BeforePrint(Cancel As Boolean)
    ActiveSheet.PageSetup.LeftFooter = ThisWorkbook.FullName
    End Sub
    If you want it for all workbooks then it's a bit (a lot) more tricky without having to add this code to each individual workbook. Let me know and I'll post the code required.

    HTH,
    D

    [ This Message was edited by: dk on 2002-03-07 09:45 ]

  3. #3
    New Member
    Join Date
    Feb 2002
    Posts
    40
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    dk, thank you for your help. I am totally ignorant of VBA, so please bear with me. Sorry for displaying such ignorance, but this is a "we need this yesterday" kind of situation, so no time to go get a book or anything sensible like that...

    After I've pasted this code, then what? Do I just close the editor, or is there a way to save my changes?

    Lindsay

  4. #4
    New Member
    Join Date
    Feb 2002
    Posts
    40
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    also, I'll just deal with the small piece of code right now and worry about other workbooks later. No need to get any more complicated

  5. #5
    New Member
    Join Date
    Feb 2002
    Location
    Louisiana USA
    Posts
    26
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Just past the code where DK asked you to. Yes, close the editor and save the file. When any worksheet is printed from the workbook the filename and it's location will be printed out on the footer of each sheet.

  6. #6
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Sydney, Australia
    Posts
    2,940
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default

    To add to what Sam said. You must make sure that the code is in the workbook code module, not in a standard module (hence the right click and View Code - this opens the workbook code module). The code will also work when doing print preview. If you try it you'll se the path in the print preview window.

    Regards,
    D

  7. #7
    New Member
    Join Date
    Feb 2002
    Posts
    40
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks, folks -- after some fumbling around, this works just right.

    Lindsay

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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