我的代码如下,它会在End Sub之前的最后一行语句中抛出此错误。有人可以建议问题是什么吗?
Sub Copy()
Set target_book = ActiveWorkbook.Sheets("Sheet2")
ActiveWorkbook.Sheets("Sheet1").Activate
last_row_2 = ActiveSheet.Range("B100000").End(xlUp).Row
For k = 2 To last_row_2
ActiveWorkbook.Sheets("Sheet1").Activate
Range("A" & k & ":Y" & k).Select
Selection.Copy
target_book.Select
last_row = target_book.Range("B100000").End(xlUp).Row
target_book.Range("B" & last_row + 1 & ":Z" & last_row + 1).Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Next k
target_book.Activate
ActiveSheet.Range("A13:Z13").AutoFilter Field:=5, Criteria1:="<>",
VisibleDropDown:=True
End Sub