0
我試圖將數據從「DATEV_RAB_UNVERBINDLICH」紙張,範圍D2:D複製到「準備上傳」紙張,範圍B2:B。VBA - 將數據從一張紙複製到另一張
我想找到最後一行的數據,然後將它們複製到另一張表。我有這樣的代碼:
Sub CopyInvoiceNo()
Dim ws, ws1 As Worksheet
Dim lastrow As Long
lastrow = .Cells(.Rows.Count, "D").End(xlUp).Row
Set ws = Sheets("DATEV_RAB_UNVERBINDLICH")
Set ws1 = Sheets("Ready to upload")
ws.Range("D2" & lastrow).Copy
ws1.Range("B4").PasteSpecial xlPasteValues
ws1.Activate
End Sub
但我收到錯誤味精無效的或不合格的參考。你能不能告訴我,我該怎麼做錯了?在你的代碼
嗯,現在我明白了。感謝您的建議!它工作正常。 – Srpic