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

copy range to first blank row in an existing spreadsheet

Status
Not open for further replies.

fitchic77

MIS
Jun 24, 2001
5
US
I have am a newbie, so excuse the simplicity. I need to copy a range I've created in Excel to the first blank row available in an Master.xls.

Any help or hints would be greatly appreciated.
THANKS!!
Andrea
 
Hello Andrea,

Try the following. To test for the destination row you could use a MsgBox (commented out here). You will of course have to replace the Worksheet("Name") with the specification for your sheets and workbooks. ActiveCell.CurrentRange will have to be replaced with the range you wish to copy.

Sub CopyToTarget()

Dim lngDestRow As Long

lngDestRow = Worksheets("Target").Cells(65536, 2).End(xlUp).Row + 2

'MsgBox lngDestRow

With Worksheets("Source")
ActiveCell.CurrentRegion.Copy Destination:=Worksheets("Target").Cells(lngDestRow, 1)
End With

End Sub


IS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top