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.
 

Some videos you may like

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Watch MrExcel Video

Forum statistics

Threads
1,118,415
Messages
5,571,977
Members
412,430
Latest member
Huuktkt
Top