Macro To Filter As Per List

  • Thread starter Thread starter Faraz A. Qureshi
  • Start date Start date
F

Faraz A. Qureshi

Any idea for having a table with a specific column be filtered as per a
predefined list, instead of selecting each and every entry in the drop down?

Thanx in advance.
 
For a VBA solution try the below example..

Your data in active sheet..Data range is ColA/ColB A1:B10..Filter criteria
range is C1:C3 (with header)

Col A Col B Col C
Header 1 Header 2 Header 1
a 1 a
a 2 b
b 3
a 4
b 5
c 6
d 7
e 8
a 9

Sub Macro2()
Range("A1:B10").AdvancedFilter Action:=xlFilterInPlace, _
CriteriaRange:=Range("C1:C3"), Unique:=False
End Sub


If this post helps click Yes
 
Back
Top