Hi members,
This is a repost, but this time with the attachment added (hopyfully)
I have a workbook for which i want to create new worksheets for every item in the filter selection.
Since i want to modify the created worksheets and only keep the values and not the pivot itself, i created a code which seems to work, but is quite slowly.
Is there a way how i can speed up this code?
I cannot seem to upload the file ....Please Login or Register to view this content.
The problem is that the following code
"For Each PI In Worksheets(MyWs).PivotTables(MyPIV).PivotFields(MyField).PivotItems
PI.Visible = True
For Each PI2 In Worksheets(MyWs).PivotTables(MyPIV).PivotFields(MyField).PivotItems
If Not PI2.Name = PI.Name Then PI2.Visible = False
Next PI2'"
is comparing each item to each other (>500 options).
What i actually want is that the code will unselect all items, except for each PI in worksheet but do not seem to get the code working.
Goal is to unselect all items in pivot table and then only choose the unique PI and create a new worksheet for it. I want to continue doing this, untill all worksheets has been created
Bookmarks