ButtonMascher
New Member
- Joined
- May 17, 2023
- Messages
- 1
- Office Version
- 2016
- Platform
- Windows
I'm trying to write a macro that involves copying data from a pivot table into a separate table. I'm hoping to keep positive and negative values separate because I'll need to sub those negative values multiple times for the data to be accurate and the "Label Filter" option seems to be for exactly that. However when I run the macro it fails to apply the label filter. I can open the label filter, press ok, and it does exactly what I want it to do. It seems that this is only a problem when a macro tries to use the feature.
Here's the faulty part of the macro:
ActiveSheet.PivotTables("PivotTable1").PivotFields("Qty").PivotFilters.Add2 _
Type:=xlCaptionIsGreaterThan, Value1:="0"
Here's the faulty part of the macro:
ActiveSheet.PivotTables("PivotTable1").PivotFields("Qty").PivotFilters.Add2 _
Type:=xlCaptionIsGreaterThan, Value1:="0"