![]() |
Excel 2K: Putting Filename & path in footer
I am using the following code to automate adding the filename and path to the
footer (thanks to J.E. McGimpsey for posting this!): Private Sub Workbook_BeforePrint(Cancel As Boolean) Dim wsSht As Worksheet For Each wsSht In ActiveWindow.SelectedSheets wsSht.PageSetup.LeftFooter = Me.FullName Next wsSht End Sub It works just fine except that it puts it in with the default size font. I would like it to have it in a smaller font, such as 8 or 7, but I cannot figure out how to modify the code to do this. When I record a macro of changing the font size in the footer, it shows it as "&8Filename & path". When I tried adding the &* in front of FullName, it gave me an error. Any suggestions would be appreciated. Lee |
Hi Lee,
Try this Private Sub Workbook_BeforePrint(Cancel As Boolean) Dim wsSht As Worksheet For Each wsSht In ActiveWindow.SelectedSheets wsSht.PageSetup.LeftFooter = "&""Arial,Bold""&8" & Me.FullName Next wsSht End Sub -- HTH RP (remove nothere from the email address if mailing direct) "FinChase" wrote in message ... I am using the following code to automate adding the filename and path to the footer (thanks to J.E. McGimpsey for posting this!): Private Sub Workbook_BeforePrint(Cancel As Boolean) Dim wsSht As Worksheet For Each wsSht In ActiveWindow.SelectedSheets wsSht.PageSetup.LeftFooter = Me.FullName Next wsSht End Sub It works just fine except that it puts it in with the default size font. I would like it to have it in a smaller font, such as 8 or 7, but I cannot figure out how to modify the code to do this. When I record a macro of changing the font size in the footer, it shows it as "&8Filename & path". When I tried adding the &* in front of FullName, it gave me an error. Any suggestions would be appreciated. Lee |
All times are GMT +1. The time now is 10:10 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com