Sub AddDataField() Dim pvt As PivotTable
Set pvt = ActiveSheet.PivotTables(1)
With pvt.PivotFields("Revenue")
.Orientation = xlDataField
.NumberFormat = "0" End With
With pvt.DataFields("Sum of NumberSold")
.Position = 2
.Function = xlCount
.NumberFormat = "0" End With End Sub