View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Pivot Table - Multiple Pivot Field Selection

Items are visible or not. You don't add them. The item list is derived
from the source data.

So loop through your items and make them either visible = true or visible =
false.

This is a guess on what you are trying to do as you explanation was not
clear to me.

--
Regards,
Tom Ogilvy


Paul Mac. wrote in message
...
Hi All,

I have a quick questions that I believe can be answered
quickly.

I have a PivotTable with the following Pivot Fields:

GROUP
NAME
DIV

What I'm wondering is whether I can select a Pivot Item
from a combination of two fields values. For instance, I
need to add items to a new collection where the item in
the "GROUP" field matches a previously selected value.

In simplist form, i need to add all items in the "NAME"
field where the "GROUP" field matches the previously
selected value.

I'm sure that the items index will help, but i can only
stay within the nominated pivot field.

Sample Code: (If it helps)

Set oPiv = frmNewProgramDetails.oPiv ' From Unfocused
Form)
oSelectedGroup = frmNewProgramDetails.cmbGroup ' Value to
match
For Each Item In oPiv.PivotFields("NAME").PivotItems
If oPiv.PivotField("GROUP").PivotItem(Item) =
oSelectedGroup Then
'I want it to add to the colListItems only if the "GROUP"
= oSelectedGroup
colListItems.Add Item
End If
Next Item


Hope someone can shed some light on this.

Thanks in advance,

Paul Mac