In the Excel worksheet, I defined say range A1:A10 as "definedvar". I'm trying to use the values in this range to drive pivot table filters. I can't figure out how to reference the defined range values I want. I stepped through the code and the code does go through the pivot table items like I want, but the "definedvar" values has nothing in it. What am I doing wrong?
For Each pi In pt1.PivotFields("COLUMN A").PivotItems
If IsError(Application.WorksheetFunction.Match(pi.Name, Range("definedvar"), 0)) Then
pi.Visible = False
Else
pi.Visible = True
End If
Next pi
debug.print range("definedvar").address
? – nutsch