错误:从一个工作簿复制到另一个工作簿时的表达式

时间:2017-04-28 19:37:07

标签: vba expression

我收到错误:以下代码中的表达式

    Destination:= wbfirst.Sheets("NTMR EC investments list").Range("A1")

剩下的代码是这样的:

'上个月提供了YYYYMM

dateFormat = Format(DateAdd("M", -1, Date), "yyyymm", 1)

'workbook with the code
Set wbfirst = ThisWorkbook

'workbook that needs to be copied over from
Set wbsecond = Application.Workbooks.Open(staticFolder & "\" & dateFormat & "\" & "Source files" & "\" & "NTMR" & " - " & dateFormat & ".xlsx", _
UpdateLinks:=0)




    wbsecond.Sheets("NTMR EC investments list").Range("A1:AD1105").Copy

    Destination:= wbfirst.Sheets("NTMR EC investments list").Range("A1")

    Stop

    wbsecond.Close savechanges:=False

    MsgBox "You have successfully transferred the NTMR File of " & dateFormat

    Application.ScreenUpdating = True
    Application.DisplayStatusBar = True

有关如何解决此问题的建议?

非常感谢

0 个答案:

没有答案