我希望能够复制工作表2的任何行,其中包含工作表1的a列中的任何值。到目前为止,我拥有此代码,但始终使下标超出范围错误。任何帮助将不胜感激。谢谢
Sub test()
Dim MyCell As Range, MyRange As Range
Dim row_counter As Long, col_counter As Long
Set MyRange = Sheets(“Sheet1”).Range("A1")
For Each MyCell In MyRange
If Cell.Value = MyCell.Value Then
Cell.EntireRow.Copy
End If
Next MyCell
End Sub