问题
Excel 2007
Sub Filtered_data_on_othersheet()
Dim i As Integer
Dim xx As String
For i = 1 To 3
On Error Resume Next
xx = Sheets("main").Range("K" & i).Value
Range("A1").CurrentRegion.AutoFilter field:=1, Criterial:=xx
Range("A1").CurrentRegion.Cells.SpecialCells(xlCellTypeConstants).Copy Destination:=Sheets(xx).Range("A1")
Next
Err.Clear
Range("A1").CurrentRegion.AutoFilter
End Sub
回答1:
Simple mistake. It should be Criteria1
not Criterial
Use the number 1
instead of the letter l
.
来源:https://stackoverflow.com/questions/33070010/compile-error-named-argument-not-found