need a macro to append data to a table

T

Tonso

Using XL2003, i am trying to automate coping cells from 1 worksheet to
another, then return to the original cells. The cells are in columns A
& B on sheet 1, and i want to append them to a table on sheet 2, in
columns A & B also, then return to the same cell in column A on sheet
1. I have no idea how to accomplish this.

Thanks...

Tonso
 
D

Don Guillett Excel MVP

Using XL2003, i am trying to automate coping cells from 1 worksheet to
another, then return to the original cells. The cells are in columns A
& B on sheet 1, and i want to append them to a table on sheet 2, in
columns A & B also, then return to the same cell in column A on sheet
1. I have no idea how to accomplish this.

Thanks...

Tonso

"If desired, send your file to (e-mail address removed) I will only look
if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results."
 
D

Don Guillett Excel MVP

"If desired, send your file to (e-mail address removed) I will only look
if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results."

dguillett
 
J

James Ravenswood

Using XL2003, i am trying to automate coping cells from 1 worksheet to
another, then return to the original cells. The cells are in columns A
& B on sheet 1, and i want to append them to a table on sheet 2, in
columns A & B also, then return to the same cell in column A on sheet
1. I have no idea how to accomplish this.

Thanks...

Tonso

This little macro assumes we are on sheet1 with the active cell in
column A on the cell we want to copy:

Sub MoveIt()
Dim s1 As Worksheet, s2 As Worksheet, rSource As Range, rDestination
As Range
Set s1 = Sheets("Sheet1")
Set s2 = Sheets("Sheet2")
Set rSource = ActiveCell.Resize(1, 2)
ady1 = rSource.Address
s2.Activate
If IsEmpty(Range("A1")) Then
i = 1
Else
i = Cells(Rows.Count, "A").End(xlUp).Row + 1
End If
s1.Range(ady1).Copy Cells(i, "A")
s1.Activate
End Sub
 

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