【发布时间】:2019-09-10 11:02:50
【问题描述】:
我在运行宏时收到错误代码:
运行时错误 450:参数数量错误或属性分配无效
基本上我只需要过滤 3 个文本 XBKK、XBKF 和 XMAI,而我无法使用下面的代码来过滤。
Dim OrigLines, LiveData As Long
Dim FirstRow As Integer
OrigLines = Sheet1.Range("A" & Rows.Count).End(xlUp).Row
FirstRow = 1
Sheets("Paste_SDR").Select
Range("$A$1:$FB" & OrigLines).Copy
Sheets("SDR - working").Select
Range("A1").Select
Selection.PasteSpecial
Rows("1:1").Select
Application.CutCopyMode = False
Selection.AutoFilter
ActiveSheet.Range("$A$1:$FB" & OrigLines).AutoFilter Field:=126, Criteria1:= _
"<>*XBKK*", Operator:=xlAnd, Criteria2:="<>*XMAI*", Operator:=xlAnd, Criteria2:="<>*XBKF*"
If Range("A" & Rows.Count).End(xlUp).Row > FirstRow Then
Range("$A$2:$FB" & OrigLines).SpecialCells(xlCellTypeVisible).Delete Shift:=xlUp
End If
【问题讨论】: