How to insert the File Name and Path...

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Anybody know how to insert the File Name and Path (as a Footer ?) in an
Excel 2000 document? I guess like a field - Word's equivalent is
Insert>Field>Document Information>FileName. I can't seem to find the same
command in Excel. A shortcut key(s) would be great, as I need this
frequently. The Help offers no help.

Thanks!

Mark
 
One way:

Put this in the ThisWorkbook code module (right-click on the
workbook title bar, choose View Code, paste the following in the
window that opens, then click the XL icon on the toolbar to return
to XL):

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet

For Each wkSht In ActiveWindow.SelectedSheets
wkSht.PageSetup.LeftFooter = ActiveWorkbook.FullName
Next wkSht
End Sub

You can substitute CenterFooter or RightFooter for LeftFooter.
 
Back
Top