You can change it by using .Function
in your case .Function = xlMax
you will need to added after orientation. This method allows you to use count, sum, avg and other xl functions
With .PivotFields(iCol)
If .Orientation = 0 Then
.Orientation = xlDataField
.Function = xlMax
End If
Now, beware that you are looping through all the pivot fields in your pivot table, therefore if you incorporate .Function = xlMax
all will appear as max
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…