Pivot item

24/01/2006 - 16:03 por Daisuke Inoue | Informe spam
Hola ...

Para este mismo comando
Sub test()
Dim pItem As PivotItem
With ActiveSheet.PivotTables("tabCargas").PivotFields("TIPO_CARGA")
For Each pItem In .PivotItems
pItem.Visible = True
Next pItem
End With
End Sub


solo que quiero hacer para todos los pivotfiels a traves de un comando For
each...
como puedo hacer para q pueda mostrar todos los campos?


Daisuke
 

Leer las respuestas

#1 KL
24/01/2006 - 22:00 | Informe spam
Hola Daisuke,

Me suena el codigo jejeje. Prueba los siguiente:

Sub test()
Dim pItem As PivotItem, pField As PivotField
With ActiveSheet.PivotTables("tabCargas")
For Each pField In .PivotFields
For Each pItem In pField.PivotItems
pItem.Visible = True
Next pItem
Next pField
End With
End Sub

o un pelin mas corto:

Sub test()
Dim pItem As PivotItem, pField As PivotField
For Each pField In ActiveSheet.PivotTables("tabCargas").PivotFields
For Each pItem In pField.PivotItems
pItem.Visible = True
Next pItem
Next pField
End Sub

Saludos,
KL


"Daisuke Inoue" wrote in message news:%
Hola ...

Para este mismo comando
Sub test()
Dim pItem As PivotItem
With ActiveSheet.PivotTables("tabCargas").PivotFields("TIPO_CARGA")
For Each pItem In .PivotItems
pItem.Visible = True
Next pItem
End With
End Sub


solo que quiero hacer para todos los pivotfiels a traves de un comando For
each...
como puedo hacer para q pueda mostrar todos los campos?


Daisuke



Preguntas similares