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

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
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,223,099
Messages
6,170,109
Members
452,302
Latest member
TaMere

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