Share via

VBA to change font size of Excel Footer

Anonymous
2019-03-14T16:20:14+00:00

Hi, I have a spreadsheet that contains footers with text.  I'm trying to find VBA that will change the font size of the text in my footers.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

4 answers

Sort by: Most helpful
  1. DaveM121 891.9K Reputation points Independent Advisor
    2019-03-14T17:22:09+00:00

    Hi djjjblawson

    With the second option, if you are getting a runtime error, you must not have a left footer, so you can remove that line of code . . . only use the line of code that applies to the footers you have, so if you only have a center footer, remove the right and left footer lines . .

    Was this answer helpful?

    3 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2019-03-14T17:34:16+00:00

    Hi, so I actually have existing text in a left, center and right footer.  I need to keep the text in these footers but only change the font size.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2019-03-14T17:19:00+00:00

    Hi, thank you for the quick reply. I tried this but ran into a couple issues.  

    1. I tried to use this code, but it erased the text that is currently on my footer.

    Sheets("Worksheet Name").Select ActiveSheet.PageSetup.RightFooter = "&""Arial""&8" & datestring

    1. I also tried to use this code, but I got a run-time error '424' object required here ".LeftFooter.FontSize = 8"

    Application.PrintCommunication = False

    With ActiveSheet.PageSetup

    .LeftFooter.FontSize = 8

    .CenterFooter.FontSize = 8

    .RightFooter.FontSize = 8

    End With

    Application.PrintCommunication = True

    Was this answer helpful?

    0 comments No comments
  4. DaveM121 891.9K Reputation points Independent Advisor
    2019-03-14T16:31:09+00:00

    Hi djjjblawson

    The VBA you need would be something like that below

    Sheets("Worksheet Name").Select ActiveSheet.PageSetup.RightFooter = "&""Arial""&8" & datestring

    Or a more fuller code would be

    Application.PrintCommunication = False

    With ActiveSheet.PageSetup
    
        .LeftFooter.FontSize = 8      
    
        .CenterFooter.FontSize = 8      
    
        .RightFooter.FontSize = 8      
    
    
    
    End With
    

    Application.PrintCommunication = True

    Was this answer helpful?

    0 comments No comments