Multiple criterias in a Pivot filter

P

Peter

Hi
(Excel 2010)

In my pivottable I have a list of names.

Now I want to show only the rows with names including "ete" or "eve".
I can set up af filter for each, but how do I filter for both of them.

Furthermore I would like to show the rows with "Johnsson"
Is there a way to do it.

Something like :
Select *
from names
where (names like %ete% or names like %eve%) and names like %Johnsson%

Example:


NAMES

John Adams (Not to to be shown)
Peter Grandjean (To be shown)
Eric Hansen (Not to be shown)
Evelyn Bond (To be shown)


Regards

Peter
 
I

isabelle

hi Peter,

Set Pi = ActiveSheet.PivotTables(1).PivotFields(1)
On Error Resume Next
For Each p In Pi.PivotItems
If p.Visible = False Then p.Visible = True
Next

For Each p In Pi.PivotItems
If p Like "*eve*" Or p Like "*ete*" Or p Like "*Johnsson*" Then p.Visible = True Else p.Visible = False
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top