Hi,
I have the following code:
i need a line that selects all items starting with "RMA" or "DMR" from the filter Base inside the Pivot table.Please Login or Register to view this content.
Thansk for the help.
Hi,
I have the following code:
i need a line that selects all items starting with "RMA" or "DMR" from the filter Base inside the Pivot table.Please Login or Register to view this content.
Thansk for the help.
For regular pivot table, there is no method to select multiple items at once. You'll need to loop through each item in a given field.
As well, each loop iteration causes pivot table to refresh slowing down the process, to avoid this, it is recommended that you set .ManualUpdate to True at start of loop and to False at end of loop.
Ex:
Please Login or Register to view this content.
?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
― Robert A. Heinlein
Something went wrong during execution. Please see attached image.Microsoft_Visual_Basic.jpgMicrosoft_Visual_Basic2.jpg
Hmm, try commenting out that line. Since you are clearing all filter and setting all items to visible at start, you really don't need to set it to .Visible = True.
If that doesn't resolve your issue, please upload sample workbook so I can test out what need to be changed.
So that worked, however, it took a long time to go through the list and filter out all other items. Is there a way to make the loop do it faster?
The total items on the list varies from 400 to 800 items.
Last edited by YuriyBaron; 05-01-2018 at 03:17 PM.
Not with regular pivottable, without making significant change to how pivot table is constructed.
Especially since, ManualUpdate = True is already used.
One approach you can test is following.
Add helper column to source data. That identifies each row as RMA, DMR or Other.
This can be done via code or formula (performance will depend on your workbook structure).
Then add another slicer from pivot table (after extending data range), using the helper column.
This will act as toggle for filtering individual items and will significantly improve performance over VBA (no need for code to loop each item).
If further help is needed, please upload sample workbook with about 50 or so lines of data, or just enough to demonstrate your issue/need.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks