Autofiltering and multiple selections

GrahamButler1970

New Member
Joined
Mar 4, 2011
Messages
8
I am looking to have more than 2 criteria in autofilter.

If you have numbers from 1 to 10 and I did not want to see the following: 2, 5, 6, 7, 9. What would the VBA code be?

I have written some code following the protocol for 2 items and it comes up with run time errors.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Specify the items to see, not the ones not to see:
Code:
   ActiveSheet.Range("$A$1:$A$20").AutoFilter Field:=1, Criteria1:=Array("1", _
        "3", "4", "8", "10"), Operator:=xlFilterValues
 
Upvote 0
Thanks for the response.

What would you do if there were potentially hundreds or thousands of items to see but never more than 5 you did not want to see.

Regards

Graham
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,672
Members
452,937
Latest member
Bhg1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top