Macro: set filter containing certain value(s)

S

Snoopy

Hey guys
Again I consult my helping friends:

I have a list of COMMENTS listed in column D, and dynamic cellvalues
"X" in range E1, "Y" in range E2 and "Z" in range E3 (based on linked
cell of comboboxes).

Now I want my macro to set a filter in my list D to only show the
exact filtered list where COMMENTS are containing either of the 3
words "X" "Y" or ""Z".

Will anyone kindly help me on this one?

Best regards
Snoopy
 
D

Dave Peterson

In xl2003 and below, I can only use two criteria for my autofilter.

So I'd either use data|filter|advanced filter.
See Debra Dalgleish's site for lots of info:
http://contextures.com/xladvfilter01.html

Or I'd add another helper column that returned an indicator (like True/False)
using a formula like:

=or(d2={"x","y","z"})
or
=sum(countif(d2,"*"&{"x","y","z"}&"*"))>0

The first formula looks for an exact match. The second allows for additional
characters ("asdfxqwer" contains an X).

Then filter to show the True's.
 
S

Snoopy

In xl2003 and below, I can only use two criteria for my autofilter.

So I'd either use data|filter|advanced filter.
See Debra Dalgleish's site for lots of info:http://contextures.com/xladvfilter01.html

Or I'd add another helper column that returned an indicator (like True/False)
using a formula like:

=or(d2={"x","y","z"})
or
=sum(countif(d2,"*"&{"x","y","z"}&"*"))>0

The first formula looks for an exact match.  The second allows for additional
characters ("asdfxqwer" contains an X).

Then filter to show the True's.










--

Dave Peterson– Skjul sitert tekst –

– Vis sitert tekst –

Thanks Dave
Ill try this
Best Regards Snoopy :)
 

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