Macro to insert data into next blank row?

J

Jim

I have a list of names, addresses, etc that I'm setting up for a mail merge.
I already have a macro that converts the names from a format like this:



Col A

Name

Address

City, state, zip


Col A Col B Col C

To this: Name Address City, State, Zip



I need to be able to take the normalized data and paste it into another
workbook that has the finished list in it. I need it to paste the new row
into the first blank row in the list and then keep moving down. Anyone know
how to do this? I'm using Excel 2003. Thanks for any help.



Jim
 
J

Jim Thomlinson

This creates a range object on Sheet 1 in the first blank cell in Row A. It
then selects the range object but that is not necessary

dim rng as range

set rng = sheets("Sheet1").cells(rows.count, "A").end(xlUp).offset(1,0)
rng.select
rng.value = "this"
rng.offsets(0, 1).value = "that"
 
M

m96

how about something like that?

---
dim wks as worksheet, i as int

set wks = worksheets("<otherWks>")
i = wks.usedrange.rows.count
i = i + 1
activesheet.range("<theRangeYouWantToCopy>").copy
activesheet.paste destination:=wks.range("A" & i)
 
Top