Insert file path and name into footer

This tutorial shows how to insert the file path and name into a footer in a specific sheet using Excel and VBA

EXCEL METHOD 1. Insert file path and name into footer

EXCEL

Select sheet > Insert tab > Text group > Header & Footer > Select footer area > Design tab > Header & Footer Elements group > File Path > Click anywhere on the sheet
1. Select the sheet in which you want to insert the file path and name in the footer.
Note: In this example we have selected Sheet1, which will display the file path of this excel workbook and the name of the workbook in the footer.
Select sheet
2. Select the Insert tab. Select Insert tab
3. Select the Text group.
4. Click on Header & Footer.
Select the Text group and click on Header & Footer
5. Select the footer area in which you want to show the file path and name.
Note: In this example we have selected the center footer area.
Select footer area
6. Select the Design tab.
7. Click on File Path in the Header & Footer Elements group.
Select Design tab and click File Path in Header & Footer Elements group
8. This will insert &[Path]&[File] in the selected footer area which will return the location of this file and its name.
9. Click anywhere on the sheet.
Insert file path and name into footer

VBA METHOD 1. Insert file path and name into footer using VBA

VBA

Sub Insert_file_path_name_footer()
'declare a variable

Dim ws As Worksheet

Set ws = Worksheets("Sheet1")
With ws.PageSetup

.CenterFooter = "&Z&F"

End With

End Sub

NOTES
Note 1: This VBA code will insert the file path and file name into the center footer area of "Sheet1".

RELATED TOPICS
Related Topic Description Related Topic and Description
How to insert a header in a specific sheet
How to insert a footer in a specific sheet
How to insert page numbers into a footer in a specific sheet
How to insert the sheet name into a footer in a specific sheet
How to insert the file path and name into a header in a specific sheet