Share via


PropertyValueHAlignment Property

PivotHAlignmentEnum

PivotHAlignmentEnum can be one of these PivotHAlignmentEnum constants.
plHAlignAutomatic
plHAlignCenter
plHAlignLeft
plHAlignRight

expression.PropertyValueHAlignment

*expression   * Required. An expression that returns a PivotView object.

Example

This example formats the alignment and the font of member property captions and values in the active view of PivotTable1.

Sub Format_MemberProperties()

    Dim ptView
    Dim ptConstants

    Set ptConstants = PivotTable1.Constants

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

    ' The following three lines of code format the
    ' font for member property captions.
    ptView.PropertyCaptionFont.Name = "Tahoma"
    ptView.PropertyCaptionFont.Size = 8
    ptview.PropertyCaptionFont.Bold = True

    ' Left-align the member property captions.
    ptview.PropertyCaptionHAlignment = ptConstants.plHAlignLeft

    ' The following two lines of code format the
    ' font for member property values.
    ptview.PropertyValueFont.Name = "Tahoma"
    ptview.PropertyValueFont.Size = 8

    ' Right-align the member property values.
    ptview.PropertyValueHAlignment = ptConstants.plHAlignRight

End Sub

Applies to | PivotView Object

See Also | PropertyValueFont Property | PropertyValueWidth Property