编译错误'命名参数未找到'

时间:2015-10-11 20:51:46

标签: excel-vba excel-2007 vba excel

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 个答案:

答案 0 :(得分:2)

简单的错误。它应该是Criteria1而不是Criterial

使用数字1代替字母l