I may resort to using multiple pivot tables if I cannot do this but I want to give it a try anyway.
Basically, I have a sheet with a pretty good amount of rows (45k+) and I want to use a pivot table to group items together so that I can get uniques only to then match them in an Access database and add new items only. I have to do that for a few columns and so I thought that filtering the table using VBA could be a good solution though I have not been able to achieve it. From MSDN I understand that it is possible to add filters using PivotFields.Add though I get an error “Argument or incorrect procedure call” (or something like that). Here’s what I have tried:
Me.PivotTables("tcd_transits").PivotFields("NOTE").ClearAllFilters
Me.PivotTables("tcd_transits").PivotFields("NOTE").PivotFilters.Add _
xlValueEquals, "NOTE", "RUBRIQUES"
The first line effectively clears the filters but the second doesn’t add a filter on “NOTE” for “RUBRIQUES” and throws the error I mentionned above. Am I completely off the path here or is there a detail I missed ?
Found it here:
http://excel.bigresource.com/Track/excel-0anuDfeJ/
The solution is to use
PivotFields.CurrentPage