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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asking for code meaning

Status
Not open for further replies.

petelam

Programmer
May 6, 2003
3
HK
Range("A" & (.Rows.Count - .Cells(1, 1).Row + 2)).copy _
Destination:=[A65336].End(xlUp).Offset(1, 0)

Can I ask how to control the destination, let say to paste the stuff into another sheet.

Thanks!!
 
Hi petelam,

The destination is a range in the same way that the source is, but first ...

The line of code you give doesn't specify precisely where you are copying from (it must be subordinate to a "With"), but the reference you have provides the cell in column A which is one row below the bottom of the range (if its from a worksheet it is specifying A65537 - an invalid address).

Assuming that you are providing a valid reference then to copy it to another sheet, just qualify the detsination reference with a sheet ...

Code:
Range("A" & (.Rows.Count - .Cells(1, 1).Row + 2)).copy _
Destination:=
Code:
Sheets("Sheet2").
Code:
[A65336].End(xlUp).Offset(1, 0)

Enjoy,
Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top