Tiger Chen
09-08-2008, 07:44 PM
For Each strPVItem In .PivotFields(strTitleINCI).PivotItems
If Not strPVItem.Name Like "*" & strInciName & "*" Then
strPVItem.Visible = False
Else
strPVItem.Visible = True
End If
Next
I created a pivot table with VBA Code. I would like to show only a few relative items among 5000 items. Now, I have to use the code above to set the visibility. It takes a long time.
Is there a way can set it all in one time, just like set it in the dialogue box manually?
By the way, I record the operation of setting the visibility in dialogue box. VBA will record my operation one item after another. It takes a second to record (to set the visibility manually) the operation. However, when I run the recorded code again, it takes a long time!!!
Thanks,
If Not strPVItem.Name Like "*" & strInciName & "*" Then
strPVItem.Visible = False
Else
strPVItem.Visible = True
End If
Next
I created a pivot table with VBA Code. I would like to show only a few relative items among 5000 items. Now, I have to use the code above to set the visibility. It takes a long time.
Is there a way can set it all in one time, just like set it in the dialogue box manually?
By the way, I record the operation of setting the visibility in dialogue box. VBA will record my operation one item after another. It takes a second to record (to set the visibility manually) the operation. However, when I run the recorded code again, it takes a long time!!!
Thanks,