How do I autofilter using an array for criteria

前端 未结 2 1991
梦毁少年i
梦毁少年i 2021-01-28 04:47

I am just learning about using arrays and am a bit stuck on how to use arrays as an input for criteria in autofiltering. I would like to set an array with values and then filter

2条回答
  •  一向
    一向 (楼主)
    2021-01-28 05:08

    May be you could try this

       fil = Split(Join(Application.Transpose(Range("list")))) ' here list is the name of the range
        Range("A1").AutoFilter field:=1, Criteria1:=fil, Operator:=xlFilterValues 'it will only filter the list values
    

提交回复
热议问题