Sub 집계함수변경()
    
    Dim i As Long
    Dim 필드수 As Long
    Dim k As Long
    Dim 피벗수 As Long
    
    피벗수 = ActiveSheet.PivotTables.Count
    
    For k = 1 To 피벗수
    
        With ActiveSheet.PivotTables(k)
        
            필드수 = .DataFields.Count
            
            For i = 1 To 필드수
            
                .DataFields(i).Function = xlSum
            
            Next
        
        End With
    
    Next

End Sub