HeaderFont Property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Returns a P ivotFont object representing the font for the headings in the data area or an item in the filter area of the specified view.

expression.HeaderFont

expression   Required. An expression that returns a PivotView object.

Remarks

Use the HeaderBackColor, HeaderForeColor, and HeaderHAlignment properties to in addition to this property to format the heading in the data area or an item in the filter area of a PivotTable list.

Example

This example formats the header for the data area and the filter area of the current view in PivotTable1.

  Sub SetHeaderProperties()

    Dim ptView
    Dim ptConstants

    Set ptConstants = PivotTable1.Constants

    ' Set a variable to the current PivotTable view.
    Set ptView = PivotTable1.ActiveView

    ' Set the background color.
    ptView.HeaderBackColor = "Gray"

    ' Set the foreground color.
    ptView.HeaderForeColor = "Blue"

    ' Set the font.
    ptView.HeaderFont = "Tahoma"

    ' Set the alignment.
    ptView.HeaderHAlignment = ptConstants.plHAlignLeft

End Sub