I'm building a macro within one workbook, to open another WB and copy a range of data, then go back to the original WB and paste the results. With the code below, I get a '1004' error (application or object defined error):
After researching '1004' errors, I tried the code below, but now get a '13' error (type mismatch):
WB.Sheets(NAME).Range(Cells(copyFrom, START_COL), Cells(copyTo, END_COL)).Select Selection.Copy
Other information you may need: WB is defined as Excel.Workbook, the 2nd workbook I'm trying to copy from. CopyFrom, copyTo and END_COL contain integers. NAME is a string variable or the tab name. Any thoughts?
Dim copy_rng as Range Set copy_rng = WB.Sheets(NAME).Range("A" & copyFrom).Resize(copyTo, END_COL)
This question generated 27 answers. To proceed to the answers, click here.
This thread is current as of December 12, 2013.