Autofilter Data based on cell value (drop-down list) in different worksheet

jdub84

New Member
Joined
Apr 5, 2013
Messages
6
I'm stuck on this problem. I've created drop-down lists in cells B3 and B4 (this is in worksheet 1), based on a column in Worksheet 2. I'd like Worksheet 2 to autofilter the data based on the drop-downs in B3 or B4, or both together. Can somebody help me write the code?

Thanks for the help - I'm not real experienced with VB.
 
Last edited:

Some videos you may like

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

abmati

Board Regular
Joined
Jul 9, 2010
Messages
175
It is easy by vba, without vba you have to do some manual exercise.
Add 2 more columns in Worksheet 2, we assume you wish to filter column A of Worksheet 2:
So in Worksheet2, Keep a formula in newly added 1st column like =IF(Sheet1!B3=A3,1,0)
Same way in newly added 2nd column keep formula like IF(Sheet1!B4=A3,1,0)
Copy these formulas till the range of your data.
Now you can filter newly added 2 columns either both with 1 or any one with 1.

I hope this will solve your problem.

Regards,

Mati
 

jdub84

New Member
Joined
Apr 5, 2013
Messages
6
Thank you for your reply. I would like to autofilter column K in Worksheet 2, based on the input values from the drop-downs in B3 and B4 in Worksheet 1. I would rather use the VBA code so I can set up a button and run the macro just by clicking.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,207
Messages
5,594,840
Members
413,944
Latest member
3xc3ln00b

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
Top