Question : is there a way to set the defaults of a pivot table?

is there a way to set the defaults of a pivot table ?
I would like the classic (drag and drop) and numeric (comma seperator with 2 decimal places)

Answer : is there a way to set the defaults of a pivot table?

Sure:

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
Public Sub FormatPivot2007()
    Dim ptf As PivotField
    With Selection.PivotTable
        ' set to classic layout
        .InGridDropZones = True
        ' then format the data fields
        .ManualUpdate = True
        For Each ptf In .DataFields
            With ptf
                .Function = xlSum
                .NumberFormat = "#,##0.00"
            End With
        Next ptf
        .ManualUpdate = False
    End With
End Sub
Random Solutions  
 
programming4us programming4us