Class HeaderFooter (Excel VBA)

The class HeaderFooter represents a single header or footer. The HeaderFooter object is a member of the HeadersFooters collection.

Item

To use a HeaderFooter class variable it first needs to be instantiated, for example

Dim hfr as HeaderFooter
Set hfr = ActiveChart.PageSetup.Pages(1).CenterFooter

The following procedures can be used to set variables of type HeaderFooter: Page.CenterFooter, Page.CenterHeader, Page.LeftFooter, Page.LeftHeader, Page.RightFooter and Page.RightHeader.

Picture

Returns a Picture object that represents a picture field included in the specified header or footer.

Dim grpPicture As Graphic
Set grpPicture = ActiveChart.PageSetup.Pages(1).CenterFooter.Picture

Text

Returns or sets a Text object that represents text included in the specified header or footer.

ActiveChart.PageSetup.Pages(1).CenterFooter.Text =