View Full Version : how to parse through pivot filtered items

08-30-2007, 04:56 AM

Excel provides visibleitems property on pivottables but there is no such property called FilteredItems. if we have to select only filetered items in vba program, what's the best way to do it...

say i have a pivotfield (customers#) which has say 100 items in it, if I apply various pivotfilters (labelfilters as well as manual filters), let's say the items reduce to 10 only, how do i parse through these 10 items only instead of all 100 items ?

i am using below now

pvtbl1.pivotfields("customers#").pivotfilters.add value1:="xyz"
for each pvitem in pvtbl1.pivotfields("customers#").visibleitems
'do something here
next pvitem

as you can see, even though i apply pivotfilter, i need to parse through all 100 visible items under Customer# field, where as on the screen I see only 10 items as filters are applied...

any suggestions ?