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
答案 0 :(得分:2)
简单的错误。它应该是Criteria1
而不是Criterial
使用数字1
代替字母l
。