我有这个VBA marco,它将所有字段值更改为Product。
Dim pt As PivotTable
Dim pf As PivotField
Dim ws As Worksheet
Set ws = ActiveSheet
Set pt = ws.PivotTables(1)
Application.ScreenUpdating = False
pt.ManualUpdate = True
For Each pf In pt.DataFields
pf.Function = xlProduct
Next pf
pt.ManualUpdate = False
Application.ScreenUpdating = True
Set pf = Nothing
Set pt = Nothing
Set ws = Nothing
End Sub
当我尝试将xlProduct更改为xlCount.Numbers时,代码不起作用。知道如何解决这个问题吗?
答案 0 :(得分:1)