Copy Data from 2 pivot table and make a new data set......

sasils

New Member
Joined
Jun 3, 2017
Messages
24
Hi,

I need help on VBA code to copy and merge data from 2 pivot tables into a single data set to be display in another sheet.

Below is data Sheet 1 in excel.

Pivot A
ShiptoSoldtoLV1LV2LV3
001ALocalNEManufacturer
002BLocalNEManufacturer
003CGlobalCETrader
004DGlobalCEWhole Sale
005EOthersSMini Mart
006EOthersSMini Mart

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


Pivot B
Mat CodeDescriptionLV1LV2
S001AAAChemicalRM
S002BBBChemicalRM
S003CCCChemicalRM
S004DDDChemicalRM
S005EEEPaperPM
S006FFFPaperPM

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>

Final Data to use data from Pivot A and B into a data set in Sheet 2. The result should look like below.

Final Table
ShiptoSoldtoLV1LV2LV3Mat CodeDescriptionLV1LV2
1ALocalNEManufacturerS001AAAChemicalRM
1ALocalNEManufacturerS002BBBChemicalRM
1ALocalNEManufacturerS003CCCChemicalRM
1ALocalNEManufacturerS004DDDChemicalRM
1ALocalNEManufacturerS005EEEPaperPM
1ALocalNEManufacturerS006FFFPaperPM
2BLocalNEManufacturerS001AAAChemicalRM
2BLocalNEManufacturerS002BBBChemicalRM
2BLocalNEManufacturerS003CCCChemicalRM
2BLocalNEManufacturerS004DDDChemicalRM
2BLocalNEManufacturerS005EEEPaperPM
2BLocalNEManufacturerS006FFFPaperPM
3CGlobalCETraderS001AAAChemicalRM
3CGlobalCETraderS002BBBChemicalRM
3CGlobalCETraderS003CCCChemicalRM
3CGlobalCETraderS004DDDChemicalRM
3CGlobalCETraderS005EEEPaperPM
3CGlobalCETraderS006FFFPaperPM
4DGlobalCEWhole SaleS001AAAChemicalRM
4DGlobalCEWhole SaleS002BBBChemicalRM
4DGlobalCEWhole SaleS003CCCChemicalRM
4DGlobalCEWhole SaleS004DDDChemicalRM
4DGlobalCEWhole SaleS005EEEPaperPM
4DGlobalCEWhole SaleS006FFFPaperPM
5EOthersSMini MartS001AAAChemicalRM
5EOthersSMini MartS002BBBChemicalRM
5EOthersSMini MartS003CCCChemicalRM
5EOthersSMini MartS004DDDChemicalRM
5EOthersSMini MartS005EEEPaperPM
5EOthersSMini MartS006FFFPaperPM
6EOthersSMini MartS001AAAChemicalRM
6EOthersSMini MartS002BBBChemicalRM
6EOthersSMini MartS003CCCChemicalRM
6EOthersSMini MartS004DDDChemicalRM
6EOthersSMini MartS005EEEPaperPM
6EOthersSMini MartS006FFFPaperPM

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

Thank you so much for your help.

Cheers.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,215,463
Messages
6,124,963
Members
449,200
Latest member
indiansth

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