Home > OS >  Trying to send range from one workbook to another, but cant manage to do it
Trying to send range from one workbook to another, but cant manage to do it

Time:11-08

My code is simple, but don't know were im failing. Please help me. It gives me error 9.

Sub SendInfoToDifferentWorkBook()
Dim LastRowA As Integer
Dim SKU As Range

LastRowA = Cells(Rows.Count, "A").End(xlUp).Row
Set SKU = Range(Cells(2, "A"), Cells(LastRowA, "A"))

Workbooks("Origin WB".xlsm").Worksheets("Sheet3").SKU.Copy Workbooks("Destiny WB.xlsx").Worksheets("Sheet1").Range("A1")

End Sub

Does the spaces in the workbooks names have anything to do with it?

CodePudding user response:

in your first Workbooks() you got 3 times ", it could come from here. regarding to the second Workbooks("Destiny WB.xlsx") you can try to set the " in the same way. hope it helped you

  • Related