Combine multiple tables into one master table - same column headings

HeyMike

New Member
Joined
Mar 1, 2012
Messages
22
I have multiple workbooks that are very similar. One table per workbook, identical column headings on all, each workbook has rows added daily.

I need to combine each table from all workbooks into one master table so I can analyze them together. Is there a formula to set this up, or perhaps a VBA script that will combine it instead of copy and pasting tables together? Example is below...

First table/workbook:
[TABLE="width: 190"]
<tbody>[TR]
[TD="align: center"]Ticket[/TD]
[TD="align: center"]Job[/TD]
[TD="align: center"]Hours[/TD]
[/TR]
[TR]
[TD="align: center"]B[/TD]
[TD="align: center"]job 1[/TD]
[TD="align: center"]5[/TD]
[/TR]
[TR]
[TD="align: center"]B[/TD]
[TD="align: center"]job 2[/TD]
[TD="align: center"]5[/TD]
[/TR]
[TR]
[TD="align: center"]B[/TD]
[TD="align: center"]job 3[/TD]
[TD="align: center"]5[/TD]
[/TR]
</tbody>[/TABLE]

Second table/workbook:
[TABLE="width: 190"]
<tbody>[TR]
[TD="align: center"]Ticket[/TD]
[TD="align: center"]Job[/TD]
[TD="align: center"]Hours[/TD]
[/TR]
[TR]
[TD="align: center"]A[/TD]
[TD="align: center"]job 1[/TD]
[TD="align: center"]3[/TD]
[/TR]
[TR]
[TD="align: center"]A[/TD]
[TD="align: center"]job 2[/TD]
[TD="align: center"]3[/TD]
[/TR]
</tbody>[/TABLE]

This is the combined output I need to produce into a new workbook:
[TABLE="width: 190"]
<tbody>[TR]
[TD="align: center"]Ticket[/TD]
[TD="align: center"]Job[/TD]
[TD="align: center"]Hours[/TD]
[/TR]
[TR]
[TD="align: center"]B[/TD]
[TD="align: center"]job 1[/TD]
[TD="align: center"]5[/TD]
[/TR]
[TR]
[TD="align: center"]B[/TD]
[TD="align: center"]job 2[/TD]
[TD="align: center"]5[/TD]
[/TR]
[TR]
[TD="align: center"]B[/TD]
[TD="align: center"]job 3[/TD]
[TD="align: center"]5[/TD]
[/TR]
[TR]
[TD="align: center"]A[/TD]
[TD="align: center"]job 1[/TD]
[TD="align: center"]3[/TD]
[/TR]
[TR]
[TD="align: center"]A[/TD]
[TD="align: center"]job 2[/TD]
[TD="align: center"]3[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I have multiple workbooks that are very similar. One table per workbook, identical column headings on all, each workbook has rows added daily.

I need to combine each table from all workbooks into one master table so I can analyze them together. Is there a formula to set this up, or perhaps a VBA script that will combine it instead of copy and pasting tables together? Example is below...

First table/workbook:
[TABLE="width: 190"]
<tbody>[TR]
[TD="align: center"]Ticket[/TD]
[TD="align: center"]Job[/TD]
[TD="align: center"]Hours[/TD]
[/TR]
[TR]
[TD="align: center"]B[/TD]
[TD="align: center"]job 1[/TD]
[TD="align: center"]5[/TD]
[/TR]
[TR]
[TD="align: center"]B[/TD]
[TD="align: center"]job 2[/TD]
[TD="align: center"]5[/TD]
[/TR]
[TR]
[TD="align: center"]B[/TD]
[TD="align: center"]job 3[/TD]
[TD="align: center"]5[/TD]
[/TR]
</tbody>[/TABLE]

Second table/workbook:
[TABLE="width: 190"]
<tbody>[TR]
[TD="align: center"]Ticket[/TD]
[TD="align: center"]Job[/TD]
[TD="align: center"]Hours[/TD]
[/TR]
[TR]
[TD="align: center"]A[/TD]
[TD="align: center"]job 1[/TD]
[TD="align: center"]3[/TD]
[/TR]
[TR]
[TD="align: center"]A[/TD]
[TD="align: center"]job 2[/TD]
[TD="align: center"]3[/TD]
[/TR]
</tbody>[/TABLE]

This is the combined output I need to produce into a new workbook:
[TABLE="width: 190"]
<tbody>[TR]
[TD="align: center"]Ticket[/TD]
[TD="align: center"]Job[/TD]
[TD="align: center"]Hours[/TD]
[/TR]
[TR]
[TD="align: center"]B[/TD]
[TD="align: center"]job 1[/TD]
[TD="align: center"]5[/TD]
[/TR]
[TR]
[TD="align: center"]B[/TD]
[TD="align: center"]job 2[/TD]
[TD="align: center"]5[/TD]
[/TR]
[TR]
[TD="align: center"]B[/TD]
[TD="align: center"]job 3[/TD]
[TD="align: center"]5[/TD]
[/TR]
[TR]
[TD="align: center"]A[/TD]
[TD="align: center"]job 1[/TD]
[TD="align: center"]3[/TD]
[/TR]
[TR]
[TD="align: center"]A[/TD]
[TD="align: center"]job 2[/TD]
[TD="align: center"]3[/TD]
[/TR]
</tbody>[/TABLE]

would be good to know which excel version if 2007 or later maybe Consolidate might be a choice??

http://office.microsoft.com/en-001/excel-help/consolidate-data-in-multiple-worksheets-HP010095249.aspx#BMconsolidate_by_position


otherwise a vba would be best.
 
Upvote 0
this could be a vba code assuming range is A:C otherwise change the range and activesheet is the 'mastersheet' where data needs to be collected

Code:
Sub heymike()
For Each sh In Worksheets
 If sh.Name <> ActiveSheet.Name Then
  With sh
   .Range("A2:C" & .Range("A" & Rows.Count).End(xlUp).Row).Copy Range("A" & Range("A" & Rows.Count).End(xlUp).Row + 1)
  End With
 End If
Next sh
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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