+ Reply to Thread
Results 1 to 2 of 2

Excel 2K: Putting Filename & path in footer

  1. #1
    FinChase
    Guest

    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. #2
    Bob Phillips
    Guest

    Re: Excel 2K: Putting Filename & path in footer

    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" <[email protected]> wrote in message
    news:[email protected]...
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1