내보내기(0) 인쇄
모두 확장

PivotField.AutoSort Method (Excel)

Office 2010

Establishes automatic field-sorting rules for PivotTable reports.

.AutoSort(Order, Field, PivotLine, CustomSubtotal)

A variable that represents a PivotField object.

Parameters

Name

Required/Optional

Data Type

Description

Order

필수

Long

One of the constants of XlSortOrder (영문) specifying the sort order.

Field

필수

String

The name of the sort key field. You must specify the unique name (as returned from the SourceName (영문) property), and not the displayed name.

PivotLine

선택

Variant

A line on a column or row in a PivotTable report.

CustomSubtotal

선택

Variant

The custom subtotal field.

This example sorts the Company field in descending order, based on the sum of sales.

ActiveSheet.PivotTables(1).PivotField("Company") _ 
 .AutoSort xlDescending, "Sum of Sales"
표시:
© 2014 Microsoft