Consolidating data with same headers from multiple worksheets into master worksheet

moonstex

New Member
Joined
Jun 18, 2015
Messages
11
Hi Guys,

PLease help me out. I need a VBA code or any other solution to produce the following.

Basically, I have two datasets where the same information is stored for different countries, and I need to merge them into one quite often.


Dataset 1 example


ABCD
1CountryTypeSub-typeAmount
2USAFruitApple3
3CanadaFruitOrange5
4SwedenVegetableTomato1
5NorwayfruitPear4
60000
70000
80000
90000
100000
110000

<tbody>
</tbody>

For every row where there is no data there is a 0

Dataset 2 example

ABCD
1CountryTypeSub-typeAmount
2AzerbaijanVegetableCucumber4
3IndiaFruitOrange1
4ThailandVegetableTomato1
5BangladeshFruitApple2
60000
70000
80000

<tbody>
</tbody>


Exactly same headers and same data but for different set of countries


Consolidated Dataset (this is what I'm trying to automate)

ABCD
1CountryTypeSub-TypeAmount
2USAFruitApple3
3CanadaFruitOrange5
4SwedenVegetableTomato1
5NorwayFruitPear4
6AzerbaijanVegetableCucumber4
7IndiaFruitOrange1
8ThailandVEgetableTomato1
9BangladeshFruitApple2

<tbody>
</tbody>

Basically, I want to copy paste all data from 2 datasets, right after each other without taking into account 0's. Zeros are basically blanks


Please help!

Thanks. S
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Be sure to publish ultimate solution on here as going offline is not allowed - this rule is applied vigorously.
 
Upvote 0

Forum statistics

Threads
1,215,378
Messages
6,124,601
Members
449,173
Latest member
chandan4057

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