bs0d
Well-known Member
- Joined
- Dec 29, 2006
- Messages
- 622
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):
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?
With the code below, I get a '1004' error (application or object defined error):
Code:
WB.Sheets(NAME).Range(Cells(copyFrom, START_COL), Cells(copyTo, END_COL)).Select
Selection.Copy
After researching '1004' errors, I tried the code below, but now get a '13' error (type mismatch):
Code:
Dim copy_rng as Range
Set copy_rng = WB.Sheets(NAME).Range("A" & copyFrom).Resize(copyTo, END_COL)
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?