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
 
G

Guest

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top