Help...
Is is possible to insert a header and/or footer into
multiple charts(Excel 2000 or 2002)? I was hoping I
could insert a common chart header/footer as is possible
with worksheets. Any help appreciated.
You could set up the headers and footers on one chart (File menu > Page
Setup), then before doing anything else, select each subsequent chart in
turn and press the F4 key, which repeats this action.
You could also select a chart, then record a macro while setting up its
headers and footers. Then edit the macro code to only do the headers
and footers, and leave out all that other page setup stuff. The final
macro might look like this:
Sub ChartHeaderFooter()
With ActiveChart.PageSetup
.LeftHeader = "&BConfidential&B"
.CenterHeader = "&D"
.RightHeader = "Page &P"
End With
End Sub
Then select each chart and run the macro.
To repeat this macro on all chart sheets and embedded charts in the
workbook, try this:
Sub AllChartsHeaderFooter()
Dim oChart as Chart
Dim oSheet as Object
Dim oChtObj as ChartObject
For Each oChart in ActiveWorkbook.Charts
With oChart.PageSetup
.LeftHeader = "&BConfidential&B"
.CenterHeader = "&D"
.RightHeader = "Page &P"
End With
Next
For Each oSheet In ActiveWorkbook.Sheets
For Each oChtObj in oSheet.ChartObjects
With oChtObj.Chart.PageSetup
.LeftHeader = "&BConfidential&B"
.CenterHeader = "&D"
.RightHeader = "Page &P"
End With
Next
Next
End Sub
- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______
> Help...
> Is is possible to insert a header and/or footer into
> multiple charts(Excel 2000 or 2002)? I was hoping I
> could insert a common chart header/footer as is possible
> with worksheets. Any help appreciated.