schnabs
Technical User
- Jan 21, 2009
- 50
Hello,
I am using the following code to copy a range from one sheet, and paste it into another. I had thought the code works, but something is wrong, as no matter how I change it, I get the entire data range pasted regardless of what I set to copy. My code is as follows:
copyrange = oxlbook2.range(oxlbook2.Sheets("May").range("B2").end("-4159"), oxlbook2.Sheets("May").Range("A65536").end("-4162"))
pasterange = oxlbook1.Sheets("YTD").Range("A65536").End("-4162")
copyrange.Copy(Destination:=pasterange)
The paste range works correctly, but like I said, no matter how I modify the copy range, I get the same result; the entire data range from book2.
Thanks in advance.
I am using the following code to copy a range from one sheet, and paste it into another. I had thought the code works, but something is wrong, as no matter how I change it, I get the entire data range pasted regardless of what I set to copy. My code is as follows:
copyrange = oxlbook2.range(oxlbook2.Sheets("May").range("B2").end("-4159"), oxlbook2.Sheets("May").Range("A65536").end("-4162"))
pasterange = oxlbook1.Sheets("YTD").Range("A65536").End("-4162")
copyrange.Copy(Destination:=pasterange)
The paste range works correctly, but like I said, no matter how I modify the copy range, I get the same result; the entire data range from book2.
Thanks in advance.