Name

pivottable.PrintTitles [= setting]

Synopsis

True uses print titles from the pivot table; False uses print titles from the worksheet. Default is False. The following code demonstrates the effect of PrintTitles by using print preview:

Sub PivotPrintPreview(  )
    Dim pt As PivotTable
    ' Run CreatePivotTable to create this pivot table.
    Set pt = ActiveSheet.PivotTables(1)
    ' Change property settings.
     pt.PrintTitles = True
     pt.RepeatItemsOnEachPrintedPage = True
     ' Print preview
     pt.Parent.PrintOut , , , True
End Sub

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.