Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50178

Autofilter with Dynamic choices?

$
0
0
Greetings all!

Excel 2010.

I would like my macro to autofilter a table based on a small list of part numbers. The small list (Table?) would be elsewhere in the same worksheet but on a different tab.

Currently, I've hard-coded the part numbers. But they will change in the future and I want the User to be self-sufficient and maintain a seperate list that the macro would use for the autofilter.

How can I do this?

Current Code:

Code:

    With ActiveSheet
    ActiveSheet.ListObjects("raw_Table").Range.AutoFilter Field:=3, Criteria1:= _
        Array("Part1", "Part2", "Part76"), Operator:= _
        xlFilterValues

What I want:

Code:

    With ActiveSheet
    ActiveSheet.ListObjects("raw_Table").Range.AutoFilter Field:=3, Criteria1:= _
        Array("Some gee whiz dynamic list!"),Operator:= _
        xlFilterValues

... please help tell me what the "Some gee whiz dynamic list" would be!

Thank you for considering my problem.

Viewing all articles
Browse latest Browse all 50178

Trending Articles