Results 1 to 3 of 3
  1. #1
    2 Star Lounger bmeacham's Avatar
    Join Date
    Jan 2001
    Location
    Austin, Texas, USA
    Posts
    191
    Thanks
    4
    Thanked 4 Times in 4 Posts

    Macro to create footer? (2003)

    Can someone suggest an automated way to put a custom footer on an Excel spreadsheet. I want the left portion to show the file name, the middle portion to show the date and time, and the right to show "Page n of N", where n is the current page and N is the total number of pages. And I want them all in Arial, 9 point italic. I do a lot of clicking on every spreadsheet to get this, and would love to hit a function key or something and have it done automatically.
    Bill Meacham
    bmeacham98 AT yahoo.com

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro to create footer? (2003)

    Recording a macro, then deleting the superfluous parts resulted in the following macro:
    <code>
    Sub SetFooter()
    With ActiveSheet.PageSetup
    .LeftFooter = "&""Arial""&9&F"
    .CenterFooter = "&""Arial""&9&D &T"
    .RightFooter = "&""Arial""&9Page &P of &N"
    End With
    End Sub
    </code>
    You can assign this macro to a custom toolbar button and/or a keyboard shortcut.

    You can also set the footer the way you want in an empty workbook, then save this as a template named Book.xlt in your XLStart folder. Excel will use it as default template for new workbooks.

  3. #3
    2 Star Lounger bmeacham's Avatar
    Join Date
    Jan 2001
    Location
    Austin, Texas, USA
    Posts
    191
    Thanks
    4
    Thanked 4 Times in 4 Posts

    Re: Macro to create footer? (2003)

    Wow, thanks for the fast reply! I'll give it a try.
    Bill Meacham
    bmeacham98 AT yahoo.com

Posting Permissions

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