If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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" wrote in message ... 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 |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding Headers and Footer to an Entire Workbook?? | Spyder | General Discussion | 5 | February 25th, 2010 03:46 PM |
Multiple Headers with the same footer | Word problems | Page Layout | 5 | December 29th, 2005 03:58 AM |
Stop page headers printing on report footer | John Baker | Setting Up & Running Reports | 2 | October 20th, 2005 04:50 PM |
Headers and Footer in Word 2000 | Kara | General Discussion | 4 | February 2nd, 2005 06:19 AM |
Headers and Footers | Specter7 | New Users | 2 | May 17th, 2004 03:51 PM |