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

End Sub