How to insert the File Name and Path...

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
 
J

J.E. McGimpsey

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.
 

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