Autofilter run by a VBA code

Gladme

New Member
Joined
Mar 8, 2018
Messages
18
Hello Board,

I have a macro automating several functions including oneadvanced autofilter. To run the autofilter
I have a criteria list of 6 variables (a table with 2 rowsand 6 columns while the top row is my data base table title). I run the macrowhen I have a specific value for each variable. My problem is for the case I wantto filter my data base table for more than one value of one of the variables. Toexplain more, my data base includes price of several goods and variables aretime, vendor name, type of good, etc. I want to run the macro to filter thedata base for a specific time, specific good but for three or more vendors. Howcan I define these values to be filtered by an advanced filter run by a macro?

Thanks in advance for your help.

 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Have a look at this excellent tutorial which explains how to add multiple conditions for advanced filter
In principle, you need to duplicate your current row for each vendor and amend your VBA to match
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,756
Messages
6,126,690
Members
449,329
Latest member
tommyarra

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