locked
code header e footer number of page doesn't work correctly RRS feed

  • Question

  • hallo,

     the code insert in the page setup "&P+1" doesn't work correctly.

    the code does not perform the mathematical calculation (e.g for the page 2, don't perform 2+1=3) but seems the "+" is interpreted like "&" ( so "2+1" becomes "21")

    any suggestion?

    thanks

    Wednesday, May 13, 2020 12:05 PM

All replies

  • Hi,
    Could you provide your code?
    Regards,

    Ashidacchi -- http://hokusosha.com

    Thursday, May 14, 2020 1:11 AM
  • hi, this is the code

    Sub SET_HEADER()
    
        Application.PrintCommunication = False
        With ActiveSheet.PageSetup
            .LeftHeader = "&P+25"
            .RightHeader = "&P-25"
        End With
        Application.PrintCommunication = True
    End Sub

    after this setting, on the printing of first page there is

    -on the left: 3

    -on the right:12

    thank you

    Thursday, May 14, 2020 11:35 AM