ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro To Filter As Per List (https://www.excelbanter.com/excel-programming/432911-macro-filter-per-list.html)

Faraz A. Qureshi

Macro To Filter As Per List
 
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.
--
Best Regards,

Faraz

Jacob Skaria

Macro To Filter As Per List
 
Check out the below link for 'Filter Items in a List'

http://www.contextures.com/xladvfilter02.html


If this post helps click Yes
---------------
Jacob Skaria


"Faraz A. Qureshi" wrote:

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.
--
Best Regards,

Faraz


Jacob Skaria

Macro To Filter As Per List
 
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
---------------
Jacob Skaria


"Faraz A. Qureshi" wrote:

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.
--
Best Regards,

Faraz



All times are GMT +1. The time now is 02:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com