Append data from Table1 to the end of table2 on click of a button

subodh97

New Member
Joined
Dec 6, 2015
Messages
1
Hi there,

I'm totally new to VBA and macros, so will need some deep level steps and code to perform the task. Thanks in advance for helping me out.

On sheet1 i've table1 which is populated by MS query refresh from oracle database. Usually user query data from the last month. On sheet2 Ive another table2 which contains data for all previous months. My problem is how to copy data from table1 and append it to table2 by user action (click of a button). The structure of both the table is same.

Example :-

Table1
[TABLE="width: 500"]
<tbody>[TR]
[TD]ColA
[/TD]
[TD]ColB
[/TD]
[TD]ColC
[/TD]
[/TR]
[TR]
[TD]T1A1
[/TD]
[TD]T1B1
[/TD]
[TD]100
[/TD]
[/TR]
[TR]
[TD]T1A2
[/TD]
[TD]T1B2
[/TD]
[TD]200
[/TD]
[/TR]
</tbody>[/TABLE]

[TABLE="width: 192"]
<colgroup><col span="3"></colgroup><tbody>[TR]
[TD]Table2

[/TD]
[/TR]
[TR]
[TD][TABLE="width: 500"]
<tbody>[TR]
[TD]ColA
[/TD]
[TD]ColB
[/TD]
[TD]ColC
[/TD]
[/TR]
[TR]
[TD]T2A1
[/TD]
[TD]T2B1
[/TD]
[TD]1000
[/TD]
[/TR]
[TR]
[TD]T2A2
[/TD]
[TD]T2B2
[/TD]
[TD]2000
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD]
After the copy/append it should look like :-

Table2
[TABLE="width: 500"]
<tbody>[TR]
[TD]ColA
[/TD]
[TD]ColB
[/TD]
[TD]ColC
[/TD]
[/TR]
[TR]
[TD]T2A1
[/TD]
[TD]T2B1
[/TD]
[TD]1000
[/TD]
[/TR]
[TR]
[TD]T2A2
[/TD]
[TD]T2B2
[/TD]
[TD]2000
[/TD]
[/TR]
[TR]
[TD]T1A1
[/TD]
[TD]T1B1
[/TD]
[TD]100
[/TD]
[/TR]
[TR]
[TD]T1A2
[/TD]
[TD]T1B2
[/TD]
[TD]200
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD="align: right"][/TD]
[/TR]
</tbody>[/TABLE]

Note - there is pivot table based on table2 on sheet3

Thanks,
 

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top