combine two sheets, summing the matching column/row quantities and adding in new any columns and rows that only appear on one of the sheets

Lisa Harris

New Member
Joined
Sep 19, 2016
Messages
17
Hi,

I have been frantically trying different methods and searching for help for a while to complete this, but unable to find a solution that allows you to combine sheets if column headers do not remain constant.

I need a macro that will produce a summary sheet combining an initial despatch log ('Before' tab) with a store orders / back orders log post despatch ('after' tab), so we can quickly view the total amount each one had of each item in the end. However, as time goes on, columns and rows get added in to a master (inserted as well as added to the end) so the 'after' sheet is likely to have additional columns (items) or Rows (stores) to the 'before' sheet and in a different order where new columns have been inserted as a result.

Is there VBA that will combine the two sheets, adding in the new 'unique' columns and rows in the correct order where necessary? then looking up the values and summing?

Any help would be much appreciated - thanks in advance


example of Before sheet:


ABCDEFGHIJ
1
2
3shop noshop nametypenew format?limesapplesbananaspearsgrapesoranges
44store Atype 1Y101210
565Store Btype 2N001310
677Store Ctype 1Y201112
7896Store Dtype 1Y201110
843Store Etype 1Y102112
9256Store Ftype 2N002221
1056Store Gtype 1N202222
11432Store Htype 1Y002422
1232Store Itype 1Y101344

<colgroup><col span="4"><col><col span="6"></colgroup><tbody>
</tbody>


example of After sheet:

ABCDEFGHIJKLM
1
2
3shop noshop nametypenew format?limeslemonsapplesbananaspears1pears2TOTAL pearsgrapesoranges
44store Atype 1Y110121310
565Store Btype 2N000132510
677Store Ctype 1Y220111212
7896Store Dtype 1Y210111210
843Store Etype 1Y110211212
9256Store Ftype 2N010221321
1056Store Gtype 1N220221322
11432Store Htype 1Y000241522
1232Store Itype 1Y110131444

<colgroup><col span="4"><col><col span="6"><col><col span="2"></colgroup><tbody>
</tbody>
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,214,649
Messages
6,120,730
Members
448,987
Latest member
marion_davis

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