Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieve Pivot field selected items 2

Status
Not open for further replies.

ETID

Programmer
Jul 6, 2001
1,867
US
Is there a way to pass only the items that are selected / checked, from a pivotlist, to an array?

Thanks In advance.
 
From Skip's suggestion:
Summat like:

incr = 0
For each pvtItem in pivotfields("PFName")
if pvtItem.visible = true then
pvtItemArr(incr) = pvtItem
incr = incr + 1
else
end if
next

Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
Got a no go here...
get object doesn't support this property or method on the line that reads...

For Each PivotItem In Sheets("Pivot_open_files").PivotTables("PivotTable1").PivotFields("Bureau / Organization")

wha di do wrong?
'----------------------------------------------
Sub return_checked_items()
Dim pvtitemarr(100)

incr = 0
For Each PivotItem In Sheets("Pivot_open_files").PivotTables("PivotTable1").PivotFields("Bureau / Organization")
If PivotItem.Visible = True Then
pvtitemarr(incr) = PivotItem
incr = incr + 1
Else
End If
Next


End Sub
 
Try...
Code:
For Each PivotItem In Sheets("Pivot_open_files").PivotTables("PivotTable1").PivotFields("Bureau / Organization").PivotItems

Skip,
Skip@TheOfficeExperts.com
 
Sorry xlbo...tried to "STAR" you too, but page will not let me.
 
What the Hey....now it worked


Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top