Hi all,
Can anyone tell me why this code isn't running?
Stopping at .PivotFilters.Add error: Application-defined or object-defined error
ThanksPlease Login or Register to view this content.
Hi all,
Can anyone tell me why this code isn't running?
Stopping at .PivotFilters.Add error: Application-defined or object-defined error
ThanksPlease Login or Register to view this content.
is there anything to actually filter?
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.
Yes, plenty
well the syntax looks fine so can only say its the structure or data
just one other thing
the field you are applying to
its not in report filter is it? because it wont work at that level
Its just a pivot table column, not value.
It does currently have a filter applied in the same column. I did not want to remove the current filter as I only want to show 1 row in the pivot table.
Is this what is causing it?
ok column is no issue
you cannot apply a filter on the current filter (of the same type..either value or label) using pivotfilter.add
you can easily test this
just clear the filter and run the code to see if it gives you the same error
That's it!
Is there a string of code I can apple so that it does NOT overwrite the text below when removing the filter?
please rephrase the question
*Apply
haha... apple
The pivot I am trying to filter is sitting above another table.
This pivot will only have 1 value at a time in the filtered column (1 row). If I need to clear the filters it either doesn't apply the next segment of code or overwrites the table below.
so you really just want to replace existing filter?
maybe
Please Login or Register to view this content.
no joy, I'm afraid.
Perhaps this
Please Login or Register to view this content.
Don
Please remember to mark your thread 'Solved' when appropriate.
Hi xlnitwit,
the code is still stopping at the .clearallfilters
I'm sure you already experienced it but VBA with pivot tables is a real finicky area
without actual example its really hard to replicate what comes in and out
if i am understanding your actual situation accurately (this is still in doubt) and no simple way cannot be found
i would run a loop for pivot items and do it manually
ie set item manually to visible and set previous visible to false
Thanks Humdingaling,
I think you might be right, how would I do that with the above code?
i cannot code without an actual example to base the code upon
i dont currently have to time to setup a dummy example
so please provide one if you want me to fill in the gaps
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks