1
在sheet1中,我有4行的标题为“Company Name”的值为“Google”,“Microsoft”,Yahoo“ now in sheet2我需要使用这3个值将Excel行作为数组传递给自动筛选器
ActiveSheet.Range(A1:AC20).AutoFilter Field:=4, Criteria1:=Array("Google", "Microsoft","Yahoo"), Operator:=xlFilterValues
但现在我希望它是动态的,所以,我将创建与公司名称为sheet1范围的数组,这个名单是在Sheet2中通过了过滤。
喜欢的东西
comp_name_array = Range(A1:A5)
这将创建数组与所有公司名称,然后通过这个数组中
ActiveSheet.Range(A1:AC20).AutoFilter Field:=4, Criteria1:=Array(comp_name_array), Operator:=xlFilterValues
感谢罗里,它的工作原理:-) – HSD