View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ronny[_3_] Ronny[_3_] is offline
external usenet poster
 
Posts: 5
Default Speed up pivot table VBA code, avoid multiple recalculations

Thank you for your reply, Lonnie M. This made me remember that I have
read that it is much better to work with arrays than objects.
I don't see how I can use your code directly. My pivot table already
exists so I just want to make changes to it, not create it.

I still thought an array could be helpful, but I'm lost at how to
apply the full array to the pivotfield at once, and not loop through
the array.

If I have:
PTF As PivotField
PTI As PivotItems
ArrayItem(t) As String

With PTF
For a = 0 To t
PTI(ArrayItem(a)).Visible = False
Next a
End With

I'm still doing one and one pivot item, and get a refresh of the
pivot table for all of them.

What I want to do is:
With PTF
PTI(ArrayItem()).Visible = False
End With

But I can't get any code to work in such a way.. :(

Anyone that can help me?

Ronny