关于VBA过滤器的代码的问题
代码如下
Dim reliquat() As String
Dim StrJoin, MyChar As String
MyChar = Chr(34)
StrJoin = Join(reliquat, MyChar & ", " & MyChar)
ActiveSheet.Range("$A$1:$L$" & n).AutoFilter Field:=12, Criteria1:=Array(MyChar & StrJoin & MyChar), Operator:=xlFilterValues
Dim reliquat() As String '先试试,如果出错就需要换成 Variant 数组'
ActiveSheet.Range("$A$1:$L$" & n).AutoFilter Field:=12, Criteria1:=reliquat, Operator:=xlFilterValues