Autofilters

eqbal

Board Regular
Joined
Sep 6, 2002
Messages
92
Hi,

This is the method in which we use the autofilter according to Excel’s VBA help: expression.AutoFilter(Field, Criteria1, Operator, Criteria2, VisibleDropDown).
I have a sheet in which I want to filter my accounts that are in range “G:G” according to the criteria that are put in range “P:P” as is shown below:

Criteria:

Banks
Customers
Sells
.....

How should I use the above code? What is “expression”? What is “Field” ( is it a range)?
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Are you trying to autofilter with more than 2 conditions ? that's not possible. You'll have to use Advanced filter (Which may suit a lot more in your case !), and you can even record a macro while you do that to get the proper structure.
 
Upvote 0
Hi,

Tnx for ur reply to my post: autofilter. No I'm not going to use autofilter with 2 or more conditions. I have written a code that autofilters some range criteria by criteria (the criteria := sheets(1).cells(12,i) ). It worked at first but after running and debugging 2 or 3 times the code (the autofilter code was untouchd)encounters a 1004 runtime error, which is quite ilogical.

I think that it is because I don't know the method in which the autofilter should be used.
 
Upvote 0

Forum statistics

Threads
1,214,626
Messages
6,120,602
Members
448,974
Latest member
ChristineC

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