ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pivottable (https://www.excelbanter.com/excel-programming/329313-pivottable.html)

Lasse Matsson

Pivottable
 
Hi

I want to hide all item in a pivotfield , but not the first one. Now I use
this code, but it takes a lot of time to loop (4000 items). Can I do it in a
other way, to do it faster?

With ActiveSheet.PivotTables("PivotTable1").PivotFields ("PRODNO")
For I = 2 To .PivotItems.Count
.PivotItems(I).Visible = False
Next I
End With

Regards // Lasse



Jim Thomlinson[_3_]

Pivottable
 
If you only want to show one product why not just drag the Prod No off of the
table and include it in the header? In the header you can just select the
first item.

HTH

"Lasse Matsson" wrote:

Hi

I want to hide all item in a pivotfield , but not the first one. Now I use
this code, but it takes a lot of time to loop (4000 items). Can I do it in a
other way, to do it faster?

With ActiveSheet.PivotTables("PivotTable1").PivotFields ("PRODNO")
For I = 2 To .PivotItems.Count
.PivotItems(I).Visible = False
Next I
End With

Regards // Lasse





All times are GMT +1. The time now is 10:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com