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
|