Move data from one table to another

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,341
Office Version
  1. 365
Platform
  1. Windows
I have two tables:

sheets("Step 3").ListObjects("User_PBoM")
sheets("Costpoint BoMs").ListObjects("BOM")

I want to move some of the field from the BoM to the last row of User_PBoM.

[Level], [Type], [Assembly], [Material], [Description], [Make/Buy] and [Qty Per] The field names are the same in both tables. Note: I am not copying all of the fields from BoM

Here is where I am stuck. Down the first column (column B) I have a filed named [Remove from PBoM?]. If the value in that row = "Remove from PBoM" I dont want to move/copy that Row.

What is the best way to do this in VBA? I dont want to delete those rows out of the BoM table - because I need that as a record that the user did want to move that row to the PBoM and I dont have a corresponding row in my USer_PBoM table where I can move all the data and then remove those rows after.

I assume I have to loop through each row of the BoM and copy and paste one row at a time.

Note: Column C can be used to find the Last row in each table.

Any help is appreciated.

Thanks
Greg



PS looking forward to the Microsoft Excel ESport challenge on ESPN this week!
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,214,915
Messages
6,122,217
Members
449,074
Latest member
cancansova

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