excelvbarowfieldsetting

Enable "Display labels from the next field in the same column (compact form)


Is there a way to enable the option "Display labels from the next field in the same column (compact form) in VBA?

img1

This only enables the "Show item labels in outline form"

ActiveSheet.PivotTables("Name of pivot table").PivotFields("Name of pivot field").LayoutForm = xlOutline

Solution

  • The syntax should be:

    ActiveSheet.PivotTables("Name of pivot table").PivotFields("Name of pivot field").LayoutCompactRow = True