Numerous OR criteria in a Filtered Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All!

I am trying to dump records from one worksheet into another, but am trying
to look for 8 different OR's in one go, as I would like the data to be pasted
as one block.

I have used so far:

Selection.AutoFilter
Selection.AutoFilter Field:=3, Criteria1:="*andy*", Operator:=x1Or, _
Criteria2:="*bob*", Operator:=x1Or, _
Criteria3:="*kat*", Operator:=x1Or, _
Criteria4:="*paul*", Operator:=x1Or, _

and so on .....


Being the dunce that I am, it doesn't work - any help or paracetomol would
be greatly appreciated.

Thanks

Andy
 
try using the 'Advanced Filter' under Tools \ Filter rather than the
'Autofilter' option.

Rob
 
AFAIK you can't. But you can put in a helper column (hide if desired)
=IF(OR(D1={"add","ddd","joe"}),1,"")
and filter on that 1 criteria
 
Here's a thought. Put this formula in D2

=OR(D2={"bob","andy","paul"})

and copy down, then filter on TRUE

Selection.AutoFilter
Selection.AutoFilter Field:=4, Criteria1:="TRUE"

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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

Back
Top