我对excel中的VBA完全陌生。下面是我的代码,每当我尝试运行它时,它会显示:
我不知道该怎么办,有人能帮我吗?"运行时错误'424':Object required".
Private Sub Workbook_Open()
Dim a, b, LastRow1, LastRow2 As Integer
LastRow1 = Sheets("BOM2").Range("A" & Rows.Count).End(xlUp).Row
LastRow2 = Sheets("SKU").Range("A" & Rows.Count).End(xlUp).Row
For a = 2 To LastRow1
For b = 2 To LastRow2
If Sheets("BOM2").Cells(a, "D").Value = Sheets("SKU").Cells(b, "D").Value Then
Sheets("SKU").Cells(b, "D").EntireRow.Copy Destination:=Sheets("Final").Range("A" & Row.Count).End(xlUp).Offset(1)
End If
Next b
Next a
End Sub
Range("A" & Row.Count)
应为
Range("A" & Rows.Count)