SortByLabel (Method)

Applies To:

PivotLabels collection, CategoryItems collection

Description:

Sets the primary sort criterion on an item by label or name rather than by reference to corresponding numeric data values. This method corresponds to the Sort by Labels feature in the Pivot and Chart sections

Syntax:

Expression.SortByLabel([SortOrder As BqSortOrder])

Expression Required:

An expression that returns a PivotLabelsTotals or CategoryItems collection.

Constants:

The BqSortOrder constant group contains the bqSortAscend and bqSortDescend values.

Example:

This example shows how to sort the top labels Product Name by region:

ActiveDocument.Sections["Pivot2"].TopLabels["Product Name"]. SortByLabel(bqSortAscend)