Position Property

The Position property returns or sets the position of the pivot item. For instance, the code:

ActiveSheet.PivotTables("Sales&Trans"). PivotFields("Store Type"). PivotItems("Franchise").Position returns the number 2, since Franchise is the second pivot item in the pivot table (see Figure 20-10). Moreover, we can reverse the positions of Company and Franchise by setting the Position of the Franchise pivot item to 1, as follows:

ActiveSheet.PivotTables("Sales&Trans"). PivotFields("Store Type"). PivotItems("Franchise").Position = 1

0 0

Post a comment