Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
FinChase
 
Posts: n/a
Default 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
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel puts a 1 at the end of my filename hammfamily Excel Discussion (Misc queries) 1 March 9th 05 12:47 AM
Opening an Excel file Sheldon Zaklow Excel Discussion (Misc queries) 0 March 3rd 05 10:29 PM
How do I enter the date last modified in the footer of an Excel d. Last modified date in footer Excel Discussion (Misc queries) 1 February 6th 05 11:12 PM
Excel aficionado wants to learn Access Hari Excel Discussion (Misc queries) 0 December 3rd 04 05:45 AM
Excel user desires to learn ABC of Access Hari Excel Discussion (Misc queries) 1 December 3rd 04 02:32 AM


All times are GMT +1. The time now is 06:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"