Dynamic filtering with criteria based on cell value in other sheet - Excel VBA

CakzPrimz

Board Regular
Joined
Oct 6, 2017
Messages
57
Hi,

I have 2 sheets A and B,
Inn sheets A, I have criteria to filter the data on sheets B.
Cell A5 value = "Civil" and I have a button beside the cell to run the macro for filtering data on sheets .
How is the code to filter data based on range value of cell A5 in sheets A, so when I changed the value of A5 into "Piping", then it will filtered the data with "Piping" criteria.

Thanks so much for your help and assistance

Best regards
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Please modify the red part of your macro.

sheets("B").Range("A1").AutoFilter field:=1, Criteria1:=sheets("A").range("A5").value
 
Upvote 0

Forum statistics

Threads
1,214,940
Messages
6,122,356
Members
449,080
Latest member
Armadillos

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