Insert file path in footer

J

Jenny

Hello,

Does anyone know how to add the file path with the file
name in a footer?

Thanks and have a wonderful day,
Jenny
 
N

Nick Hodge

Jenny

I versions before XP (2002) this could only be done with code. In XP & 2003
this can now be done in File>Page setup...Header/Footer and header and
footer custom options.

The code you need to put in your personal.xls workbook or similar for
versions before is

Sub PathAndFileInFooter()
ActiveSheet.PageSetup.LeftFooter = ActiveWorkbook.FullName
End Sub

This is non-dynamic, so if you change the name of the workbook it needs to
be run again and the workbook needs to be saved for the first time before
the path will show


--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
 
G

Gord Dibben

Jenny

If using XL2002 or 2003, there are icons in Headers/Footers Custom section for
Path and Filename.

If you are not using XL2002 or 2003 you have to use a macro to do this.

Sub PathInFooter()
ActiveSheet.PageSetup.RightFooter = ActiveWorkbook.FullName
End Sub

The same code could be placed into a Workbook_BeforePrint routine.

If unfamiliar with macros visit David McRitchie's website for basics.

http://www.mvps.org/dmcritchie/excel/getstarted.htm

Gord Dibben Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top