Pivot Table field settings

H

HBA

How can I change the default settings in the field settings? I want it to SUM instead of COUNT. I am having to change multiple fields one at a time. Thanks.
 
D

Debra Dalgleish

You can't change the default settings for the data fields. If a field
contains blank cells, or cells with text, it will default to COUNT.
Otherwise, it will SUM.

You could change existing data fields with a macro:
'=========================
Sub PivotSumData()
'changes data fields to SUM
Dim pt As PivotTable
Dim pf As PivotField
For Each pt In ActiveSheet.PivotTables
For Each pf In pt.DataFields
pf.Function = xlSum
Next pf
Next pt
End Sub
'====================
 
Top