+ Reply to Thread
Results 1 to 2 of 2

Headers and Footer on the Chart do not work??????

  1. #1
    maperalia
    Guest

    Headers and Footer on the Chart do not work??????

    I have this program that take values from the cell B3 an B4 on th Sheet1 and
    put them automatically in all headers and footers in all the worksheets (see
    below).
    However, when I run the program all the sheets got the header and footer
    except the sheets that have chart.
    Could you please help me to fix this problem?.

    Thanks in advance.

    Maperalia




    Option Explicit
    Sub HeadersAndFooters()
    Dim WS As Worksheet
    For Each WS In Worksheets

    '***********Header***********
    WS.PageSetup.RightHeader = "&14&B&I" &
    Format(Worksheets("Sheet1").Range("B3").Value)

    '***********Footer***********
    WS.PageSetup.LeftFooter = "&14&B&I" &
    Format(Worksheets("Sheet1").Range("B4").Value)

    Next WS
    End Sub


  2. #2
    Daniel CHEN
    Guest

    Re: Headers and Footer on the Chart do not work??????

    Charts sheets is not a worksheet.
    So charts are not in the collection of ActiveWorkbook.Worksheets, they are
    in the collection of ActiveWorkbook.Charts.
    In your program, I think you apply the footer and header to all worksheets,
    not include charts.

    --
    Best regards,
    ---
    Yongjun CHEN
    =================================
    XLDataSoft - Data Analysis Expert, Excel/VBA Specialist
    - - - - www.XLDataSoft.com - - - -
    Free Excel-Based Data Processing Tool is Available for Download




    =================================
    "maperalia" <[email protected]> wrote in message
    news:[email protected]...
    >I have this program that take values from the cell B3 an B4 on th Sheet1
    >and
    > put them automatically in all headers and footers in all the worksheets
    > (see
    > below).
    > However, when I run the program all the sheets got the header and footer
    > except the sheets that have chart.
    > Could you please help me to fix this problem?.
    >
    > Thanks in advance.
    >
    > Maperalia
    >
    >
    >
    >
    > Option Explicit
    > Sub HeadersAndFooters()
    > Dim WS As Worksheet
    > For Each WS In Worksheets
    >
    > '***********Header***********
    > WS.PageSetup.RightHeader = "&14&B&I" &
    > Format(Worksheets("Sheet1").Range("B3").Value)
    >
    > '***********Footer***********
    > WS.PageSetup.LeftFooter = "&14&B&I" &
    > Format(Worksheets("Sheet1").Range("B4").Value)
    >
    > Next WS
    > End Sub
    >




+ 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