Excel 97 inserting file path into footer

  • Thread starter Thread starter Deb
  • Start date Start date
D

Deb

Is there a way I can have a file path automatically
inserted on a document. In Microsoft Word, I am able to
insert the complete file path into a footer by going
through Autotext and then header/footer. There is then an
option which will insert the file path.

I can't seem to figure this out for Excel. Help!
 
Hi Deb,

With VBA

Private Sub Workbook_BeforePrint(Cacel As Boolean)
With ActiveWorkbook
.ActiveSheet.PageSetup.LeftHeader = Activeworkbook.Path
End With
End Sub

goes in the ThisWorkbook code module

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Hi
Depends on your Excel version in Excel 2002+ this is an
option in the header/footer dialog within the pagesetup
dialog

Prior to this versions you'll need VBA. Put the following
code in your workbook module (not in a standard module):
Private Sub Workbook BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In me.Worksheets
With wkSht.PageSetup
.CenterFooter = me.fullname
End With
Next wkSht
End Sub
 
Thanks so much!
-----Original Message-----
Hi
Depends on your Excel version in Excel 2002+ this is an
option in the header/footer dialog within the pagesetup
dialog

Prior to this versions you'll need VBA. Put the following
code in your workbook module (not in a standard module):
Private Sub Workbook BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In me.Worksheets
With wkSht.PageSetup
.CenterFooter = me.fullname
End With
Next wkSht
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany



.
 
Thanks, I really appreciate the info!
-----Original Message-----
Hi Deb,

With VBA

Private Sub Workbook_BeforePrint(Cacel As Boolean)
With ActiveWorkbook
.ActiveSheet.PageSetup.LeftHeader = Activeworkbook.Path
End With
End Sub

goes in the ThisWorkbook code module

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)




.
 

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