Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying and Pasting Excel Ranges

Status
Not open for further replies.

schnabs

Technical User
Jan 21, 2009
50
0
0
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.
 
Bump anyone? I really have no idea what is going on.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top