Macro - Adding Copied Data to BOTTOM of a Table

mknipfer

New Member
Joined
Oct 12, 2015
Messages
5
Hey Friends,

I have a table on 'Sheet1' in my workbook. On 'Sheet 2' I have some formulas happening to determine what needs to be added to the table on 'Sheet 1'. When it's determined what needs to be added to the table, I need that data to be appended to the BOTTOM of the table on 'Sheet1' after a button is clicked to confirm. What needs to be added to the table will show up in 'Sheet2' in cells A9:B9.

The simplified version of the ask:
  • User clicks button
  • Info in Cells A9:B9 on Sheet2 is copied
  • Copied info is pasted at the END of the table on Sheet1 Located in Columns P:Q

I've seen a few different posts about things like this - but I can't make anything work properly. Any thoughts? I appreciate it, all!
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
You don't say which fields in the table the data is to be copied to.

This code adds a row to the first table on Sheet1 and copies the data from A9:B9 on Sheet2 to the first 2 columns in the new row.
Code:
Dim tbl As ListObject
Dim rw As Range

    Set tbl = Sheets("Sheet1").ListObjects(1)
    
    
    Set rw = tbl.ListRows.Add.Range
    
    Sheets("Sheet2").Range("A9:B9").Copy rw
 
Upvote 0

Forum statistics

Threads
1,214,405
Messages
6,119,323
Members
448,887
Latest member
AirOliver

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