這可能會來找你作爲一個有趣的建議,但美女是永遠不會在編寫複雜的代碼,但在編寫簡單的代碼,你可以明白,即使你是看它說一句一年下來行:)
後
總是在簡單易懂的線條中分解您的代碼。例如,我已將您的請求與您現有的代碼結合起來。我已經宣佈了相關的變量(見獲取拉斯特羅,表名等)
這是你正在嘗試?
Option Explicit
Const wbPath = "I:\sales\Funnel\funnel.xls"
Sub Sample()
Dim wbI As Workbook, wbO As Workbook
Dim wsI As Worksheet, wsO As Worksheet
Dim wsILrow As Long, wsOLrow As Long
'~~> Input Workbook
Set wbI = ThisWorkbook
Set wsI = wbI.Sheets("missing_artikels")
'~~> Output Workbook
Set wbO = Workbooks.Open(wbPath)
Set wsO = wbO.Sheets("funnel")
wsOLrow = wsO.Range("A" & wsO.Rows.Count).End(xlUp).Row + 1
With wsI
wsILrow = .Range("F" & .Rows.Count).End(xlUp).Row
.Range("A1:F" & wsILrow).Copy wsO.Range("A" & wsOLrow)
End With
'
' '~~> Rest of the code
'
End Sub
HTH