I use Getpivotdata quite extensively to build and present data tables as I want them, but I have run into a (presumably not uncommon) problem.
(How) Can I use wildcards or pattern matching on pivotfields and data?
Typically, I extract all of the specific data I'm interested in:
intClosed(intCounter) = .GetPivotData(.PivotFields(1), .PivotFields(1).Name, _
strPee, .PivotFields(2).Name, "Closed").Value
intFixed(intCounter) = .GetPivotData(.PivotFields(1), .PivotFields(1).Name, _
strPee, .PivotFields(2).Name, "Fixed").Value
intOpen(intCounter) = .GetPivotData(.PivotFields(1), .PivotFields(1).Name, _
strPee, .PivotFields(2).Name, "Open").Value
...and then want to hoover the rest up into one or more buckets.
I'd *like* something similar to:
intChangeReqs(intCounter) = .GetPivotData(.PivotFields(1), .PivotFields(1).Name, _
strPee, .PivotFields(2).Name, "CR*").Value
...to total up anything matching the string-pattern CR....
Can this be done easily? The only way I can think of doing it is to extract all of the pivot data items into an array (say), whittle these down using some pattern matching, and then loop through the processed array with Getpivotdata...
Sounds like a plan, but has someone thought of a better approach?