Home |
Search |
Today's Posts |
#3
![]() |
|||
|
|||
![]()
I've built on all the advice received to date to construct the following
macro, which changes the header or footer on all charts (special thanks to Debra Dalgleish for the basis) footer: ========================================== Sub ChartFooters() Dim ws As Worksheet Dim chObj As ChartObject Dim ch As Chart For Each ws In ActiveWorkbook.Worksheets For Each chObj In ws.ChartObjects With chObj.Chart.PageSetup .LeftFooter = "&8" & "Prepared by yourname yourdate" .RightFooter = "&8" & "Printed &T on &D" End With Next chObj Next ws For Each ch In ActiveWorkbook.Charts With ch.PageSetup .LeftFooter = "&8" & "Prepared by yourname yourdate" .RightFooter = "&8" & "Printed &T on &D" End With Next ch End Sub ================================================== = and for the headers ================================================== = Sub ChartHeaders() Dim ws As Worksheet Dim chObj As ChartObject Dim ch As Chart For Each ws In ActiveWorkbook.Worksheets For Each chObj In ws.ChartObjects With chObj.Chart.PageSetup .LeftHeader = "&8 " & Application.ActiveWorkbook.FullName .RightHeader = "&A" End With Next chObj Next ws For Each ch In ActiveWorkbook.Charts With ch.PageSetup .LeftHeader = "&8 " & Application.ActiveWorkbook.FullName .RightHeader = "&A" End With Next ch End Sub ================================================== ==== Next question: how can I print date in long form (i.e. dddd, mmm dd, yyyy) in place of &D which returns 04/07/2005? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Print all charts in a workbook (multiple worksheets) | Charts and Charting in Excel | |||
multiple pie of pie charts | Charts and Charting in Excel | |||
Multiple charts in ChartSpace; problems with double Categories | Charts and Charting in Excel | |||
Multiple charts in ChartSpace; problems with double Categories | Charts and Charting in Excel | |||
Macro for multiple charts | Excel Worksheet Functions |