Forum Home
Press F1
 
Thread ID: 58716 2005-06-09 23:50:00 File Name/Path footers in Excel andrew_ivey (7809) Press F1
Post ID Timestamp Content User
362574 2005-06-09 23:50:00 Simple question hopefully, in Word we put in the footer the filename and path so everyone can find the file, but the customer footer option in Excel only gives you the file name, and you have to manually type the path to the file.
Anyway to create this automatically?
Ta,
Andrew.
andrew_ivey (7809)
362575 2005-06-09 23:57:00 Try this in the footer or header:

&[Path]&[File]
Marlboro (4607)
362576 2005-06-10 02:15:00 Up to and including Excel 2000 - [Path] is not recognised in a header or footer - don't know about compatibility with later versions of Excel.

You can automatically add the full path and name of the file via macro code.
The following macro code captures the BeforePrint event and inserts the left footer as full file path and name just prior to the job being printed.

With the workbook open, press <Alt> and <F11> to open the VB editor,
right click on the ThisWorkbook icon and select View Code and paste the following code. Press <Alt><F11> again to return to the workbook.

If any worksheet in the workbook is printed, the footer will be inserted.
File Save the workbook to retain this feature.

HTH

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.LeftFooter = ActiveWorkbook.FullName
End Sub
rad_s4 (7401)
1