Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata
With ActiveSheet.PivotTables("PivotTable").PivotFields("Customers")
 .Orientation = xlRowField
 .Function = xlCount 
 .Position = 1
End With

Orientation options:

https://docs.microsoft.com/en-us/office/vba/api/excel.pivotfield.orientation

 .Orientation = xlHidden 
 .Orientation = xlRowField 
 .Orientation = xlColumnField 
 .Orientation = xlPageField 
 .Orientation = xlDataField

Function Settings:

.Function = xlSum
.Function = xlCount
.Function = xlAverage
.Function = xlMax
.Function = xlMin

Sorting:

https://docs.microsoft.com/en-us/office/vba/api/excel.pivotfield.autosort

.AutoSort xlDescending, "Received"



  • No labels