Pra vc que ver que até em fórum eu to tentando…rsrsrsrsrsr

Hi,
I have a non-OLAP Pivot table and I need to take the multiple items selected into "Report Filter" fields (i am not calling this items as "pages" to avoid OLAP terminology) and bring them to another non-OLAP Pivot table.
When "multiple items" is not enabled it is easy - using the property .pivotfield.currentpage.
But I've tried to do the same using the collection or array from property .pivotfield.currentpagelist with no success.
I think currentpagelist property does not work on non-OLAP Pivot tables.

I've could do what I need building an array with the visible items into the report filter field to be "cloned" and using this array to make the items visible on the other pivot table. The problem is, doing in this way, in the second step, I have to make the items visible one by one (with a loop over the array items) and it takes a lot !(the code I used is copied below)
I am pretty sure I can “implant” the visible items in the second pivot in just on command, but I don´t know how!

Could you help-me ?


-----------------------------------------------------
Sub espelha()

Dim myarray(1 To 20, 0 To 9999) As Variant
Application.ScreenUpdating = False

j = 1
i = 1
x = 1

With ActiveSheet.PivotTables("tabref")
For Each campo In .PageFields
j = 1
For Each iten In campo.PivotItems
If iten.Visible = False Then
mray = iten.Name
myarray(i, j) = mray
j = j + 1
End If
Next iten
myarray(i, 0) = Array(campo.Name, j - 1)
i = i + 1
Next campo

End With

With ActiveSheet.PivotTables("tabslave")
For a = 1 To i - 1
If Not IsError(.PivotFields(myarray(a, 0)(0)).ClearAllFilters) Then
.PivotFields(myarray(a, 0)(0)).ClearAllFilters
For b = 1 To myarray(a, 0)(1)
.PivotFields(myarray(a, 0)(0)).PivotItems(myarray(a, b)) _
.Visible = False
Next b
End If
Next a
End With

End Sub