Folder name in footer

  • Thread starter Thread starter Paul N
  • Start date Start date
P

Paul N

How do I get the folder(s) name(s) into the footer of my
Excel'97 Book.xlt template?
 
Paul,

reprint.

This code, placed in the ThisWorkbook code module, automatically sets the
full name when printing.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.LeftFooter = ThisWorkbook.FullName
End Sub


If you just want the path, change FullName to Path.


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
hi Paul
try
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In ActiveWindow.SelectedSheets
With wkSht.PageSetup
.LeftFooter = ThisWorkbook.FullName
End With
Next wkSht
End Sub

HTH
Frank
 
One way:

Public Sub PathAndFileNameInFooter()
Dim wsSht As Worksheet
For Each wsSht In ActiveWindow.SelectedSheets
wsSht.PageSetup.LeftFooter = ActiveWorkbook.FullName
Next wkSht
End Sub

You can use .CenterFooter or .RightFooter instead.

To automate this, take a look here:

http://www.mcgimpsey.com/excel/fullnameinfooter.html
 

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

Back
Top