0
私はすべての3つのフィールドでピボットを作成しましたが、私は成功し PivotFilters.AddのfilterTypeを使用することはできません。この使用のfilterType:= xlValueIsGreaterThanをエクセル2016でVBA
Name Order Amount Location
Grace 120000 new jersey
Tom 200000 baltimore
Rick 5000000 hyderabad
Hari 600000 denver
Raj 4000000 Delhi
Victoria 300000 New York
のように見えるのテーブルを持っている:= xlValueIsGreaterThan
オプションが正常に...私のコードに間違っていますか?声明であなたの最後の代わりに
Sub addFields()
With ActiveSheet.PivotTables(1)
'First row field
With .PivotFields("Name")
.Orientation = xlRowField
.Position = 1
End With
'Report Filter field
With .PivotFields("Location")
.Orientation = xlPageField
.Position = 1
End With
'Order Amount or numerical data in the Values field
.AddDataField ActiveSheet.PivotTables(1).PivotFields("Order Amount"), _
"Sum of Amount", xlSum
End With
With .PivotFields("Sum of Amount").PivotFilters.Add filterType:=xlValueIsGreaterThan DataField :="Sum of Amount" value1:=4000000
End With
End Sub