PDA

View Full Version : [SOLVED] URGENT! GETTING DATA FROM ONE WORKBOOK TO ANOTHER USING VARIANT



ytjjjtyj
06-18-2019, 07:48 AM
Hello,
So I have a bunch of numbers in four rows in hello1.xlsm.
I have an empty workbook called hello2.xlsm.
From hello2.xlsm- I want to open hello1.xlsm, get all the numbers in rows one and three, and order them onto hello1.xlsm workbook in the first and second rows respectively.
My code is giving me a "Run time error 438, object doesn't support this property or method" on the line below where I am attempting to move the variant data I have stored onto my hello2 workbook.
Worksheets("Sheet1").Range("A1:LF2").hello2.Value = Table

Please help, how do I fix this?

Paul_Hossler
06-18-2019, 10:02 AM
Try



Worksheets("Sheet1").Range("A1:LF2").Value = Table

ytjjjtyj
06-18-2019, 10:33 AM
It worked! Thank you so much!
However, I have another issue.
Say I wanted to get all the numbers in row 1 except the 2nd,3rd, and 4th value from hello1 workbook. Is it possible to do that in the same line I am calling the whole row in?
This is the line that calls it:
Table(2, j) = wbk.Worksheets("Sheet1").Range("first_value").Item(1, j)