Aufilter by contents in another cell

shakeregg

New Member
Joined
Sep 2, 2018
Messages
39
Hey all,

Hopefully a quick one for you guys.

I am looking to auto filter G6:G500 depending on the contents in G4.

For example, if G4 contains 'Fred' all the G7:G500 cells containing 'Fred' are filtered and become visible. If G4 changed to 'Dave' all the cells in G7:G500 which contain 'Dave' will be filtered and become visible. G6 contains the header 'Names'

Cheers in advance all if anyone can help.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Cheers for replying!

Yep tried that but unfortunately it's not filtering automatically when G4 changes
 
Upvote 0
if A1 = "NAME" and in A2 y'll put the name
the table is in A5 to A11 and in A5 also ="NAME" in A6=dave/A7=john ....
you ca use this :

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    Range("A5:C11").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:=Range("A1:A2"), Unique:=False
End Sub
 
Last edited by a moderator:
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,279
Members
452,630
Latest member
OdubiYouth

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