VBA to build table based on 2 spreadsheets

JamieT

New Member
Joined
Jun 23, 2014
Messages
1
Hi Guys & Gals - I really need some with VBA. I have two spreadsheets and i need to build a table out of them.
First spreadsheet tells me which builds are against which equipment numbers (the builds are the A numbers across the top)

[TABLE="width: 650"]
<tbody>[TR]
[TD]Eq No.[/TD]
[TD]A465[/TD]
[TD]A506[/TD]
[TD]A507[/TD]
[TD]A508[/TD]
[TD]A510[/TD]
[TD]A511[/TD]
[TD]A514[/TD]
[TD]A525[/TD]
[TD]A561[/TD]
[TD]A557
(mm)[/TD]
[TD]A560[/TD]
[/TR]
[TR]
[TD]96550153[/TD]
[TD][/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]900[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]96550157[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]96550158[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]96550160[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]96550162[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]96550163[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Second spreadsheet tells me which spare parts and quantity are against which builds

[TABLE="width: 1119"]
<tbody>[TR]
[TD]Part No[/TD]
[TD]A506[/TD]
[TD]A507[/TD]
[TD]A508[/TD]
[TD]A510[/TD]
[TD]A511[/TD]
[TD]A514[/TD]
[TD]A515[/TD]
[TD]A516[/TD]
[TD]A525[/TD]
[TD]A557[/TD]
[TD]A560[/TD]
[/TR]
[TR]
[TD]BAA47259[/TD]
[TD][/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]3[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]XLA0617[/TD]
[TD][/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]1[/TD]
[TD][/TD]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]BAC1718[/TD]
[TD][/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]BAE3982[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD]1[/TD]
[TD][/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

However I need to figure out how to make a table of equipment numbers and associated spare parts with sum quantities.

[TABLE="width: 201"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]eqnum[/TD]
[TD]part no[/TD]
[TD]Qty[/TD]
[/TR]
[TR]
[TD="align: right"]96550153[/TD]
[TD] BAE3982[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="align: right"]96550153[/TD]
[TD] BAA47259[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]96550153[/TD]
[TD] XLA0617[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]96550153[/TD]
[TD] BAC1718[/TD]
[TD="align: right"]2[/TD]
[/TR]
</tbody>[/TABLE]

Can anyone help? It doesn't necessarily have to sum the quantities, it could repeat part numbers with different quantities and then i could put it into a pivot table to get the quantities summed and remove the duplicate part nos.

Really hoping someone can help me - This seems impossible.
 
Last edited:

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