File path in footer

E

Eric

Hello,

I am trying to have the path + filename of my spreadsheet to appear
automatically in the footer. I can put the page number, the filename, the
sheet name, etc... but I can't figure out the "field code" for the path.

Can you help?

Thank you.

Eric.
 
N

Norman Harker

Hi Eric!

This is built into Excel 2002 and 2003



Put the following in the footer:
&[Path]&[File]



But for Excel 97 and Excel 2000



You need a macro (or just type the full name in):



This subroutine which must be put in ThisWorkbook module puts the path
and workbook name in the footer.



Private Sub Workbook_BeforePrint(Cancel As Boolean)

ActiveSheet.PageSetup.LeftFooter = ActiveWorkbook.FullName

End Sub


--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
[email protected]
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
Top