Share via


GroupedWidth Property

Returns or sets the width of the specified field (pixels) when the field is displayed on the row axis or the column axis. The default value is 50 pixels. This property is ignored if the GroupedAutoFit property for the specified field is set to True. Read/write Long.

expression.GroupedWidth

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

Applies to | PivotField Object

See Also | GroupedAutoFit Property | GroupedBackColor Property | GroupedFont Property | GroupedForeColor Property | GroupedHAlignment Property | GroupedHeight Property

Example

This example disables the GroupedAutoFit property of the "ProductName" field in PivotTable1 and then sets the width of the field to 150 pixels.

Sub Set_ColumnWidth()
    Dim fldProducts
    
    ' Set a variable to the ProductName field.
    Set fldProducts = PivotTable1.ActiveView.FieldSets("ProductName").Fields(0)
    
    ' Set the GroupedAutoFit for the ProductName field.
    fldProducts.GroupedAutoFit = False
    
    ' Set the width of the ProductName field to 150 pixels.
    fldProducts.GroupedWidth = 150
End Sub