• VBA Code to change Font in Footer

    Author
    Topic
    #496833

    Hi
    I have code to change the font size of a cell reference in the Left footer, but cannot change the font size in the Center footer.
    This is the code I am using:
    ActiveSheet.PageSetup.LeftFooter = “&25” & Range(“D11”).Value
    ActiveSheet.PageSetup.CenterFooter = “&25” & Range(“D13”).Value

    Cell D11 prints in a 25 font size in the left footer, but D13 does not print at all.

    If (“&25” &) is deleted in the 2nd line, Cell D13 is printed, but not in font size 25!
    Any help appreciated
    Regards
    Keith P

    Viewing 2 reply threads
    Author
    Replies
    • #1471147

      Just a thought, but is it possible the 25 pt font makes the center text too big to fit in the space? Try reducing the size in the code incrementally and see if the text appears at any point.

      Best, Kim

    • #1471318

      What is in D13? Does it help if you put a space before the text:

      Code:
      ActiveSheet.PageSetup.CenterFooter = "&25 " & Range("D13").Value
      • #1472048

        What is in D13? Does it help if you put a space before the text:

        Code:
        ActiveSheet.PageSetup.CenterFooter = "&25 " & Range("D13").Value

        Many thanks for all your comments. However found that if I stated Cell d13 as text, then the code worked as follows with two cell ranges (D11) and (D13). D11 is a text, but D13 appears to be treated as a number.

        ActiveSheet.PageSetup.LeftFooter = “&””Arial”” &16″ & Range(“D11”).Value & Range(“D13”).Text

    • #1472049

      Keith,

      If cell D13 contains a number use Format(Range(“D13”).value) that will convert it to test and allow the concatenation. HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    Viewing 2 reply threads
    Reply To: Reply #1472049 in VBA Code to change Font in Footer

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel