John Jairo V
Well-Known Member
Greetings to all of you!
I have this VBA code:
Initially, all the items are expanded.
In vector a I have the names of the items that I want to collapse. This works fine when I collapse just one item, but when the loop collapse the second one, the first get expand. what is going on? How can I prevent this behaviour? There are a way to collapse two (or more items) without issues with VBA?
I appreciate your help. Blessings!
I have this VBA code:
Code:
Set pT = ActiveSheet.PivotTables("Liquidation")
Set pF = pT.PivotFields("[Vessel_LQ].[District].[District]")
For i = 1 To UBound(a)
pF.PivotItems("[Vessel_LQ].[District].&[" & a(i) & "]").DrilledDown = False
Next i
Initially, all the items are expanded.
In vector a I have the names of the items that I want to collapse. This works fine when I collapse just one item, but when the loop collapse the second one, the first get expand. what is going on? How can I prevent this behaviour? There are a way to collapse two (or more items) without issues with VBA?
I appreciate your help. Blessings!
Last edited by a moderator: