I've got a pivot table in an Excel 2010 spreadsheet that gets its data from Access. Whenever I add fields to the "Values" area, it always defaults to "Count" instead of "Sum". I would appreciate it if someone could tell me how to craft a "For...Each" loop to run through all the items in the Values area and change them to Sum, rather than Count.
I recorded a macro of me changing one manually and this is what I got:
I tried typing in a For/Each loop manually with no success.
Additionally, I'll have to extract the name of each item in the Values area so I can change it to reflect the change to xlSum.
I appreciate your help!
Thanks!!
Matt
I recorded a macro of me changing one manually and this is what I got:
Code:
With ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"Count of Oil Volume VolTDay")
.Caption = "Sum of Oil Volume VolTDay"
.Function = xlSum
End With
I tried typing in a For/Each loop manually with no success.
Additionally, I'll have to extract the name of each item in the Values area so I can change it to reflect the change to xlSum.
I appreciate your help!
Thanks!!
Matt