MrExcel Publishing
Your One Stop for Excel Tips & Solutions

If Statment for filters?

Posted by paul Magruder on June 20, 2001 4:10 AM

Is there code that will allow me to search for a number in 3 columns, then filter the data accorningly?

What I need is...if 1234 is found in in columns C, D, or E, then show those rows.....


Posted by Mark W. on June 20, 2001 8:41 AM

Create a criteria and use it along with an
Advanced AutoFilter. Suppose C1:E5 contains...


...and that you've specified the following criteria
in cells G1:I4...


An Advanced AutoFilter using this criteria range
will display all rows except 4:4.

For more on criteria see the Excel Help topic for
"Examples of advanced filter criteria".