VBA code for copying and combining data from 2 sheets (joining 2 tables into a new one)

mulmar74

New Member
Joined
Apr 3, 2017
Messages
1
Hello,

I am looking for some help with my little challenge.

I am trying to combine data from 2 different sheets in an automated way, but I don't know VBA and macro well enough to get this to work without help.

I have 2 sheets and I want all the combinations from the to sheets to be copied to sheet3:

To make it easier to explain this if give an example of my situation (my actual tables are much bigger, but for explaining it this should be sufficient)
SHEET1
itempricestartend
ABC101-1-1731-12-17
DEF151-1-171-1-18
GHI201-3-173-3-18

<tbody>
</tbody>

SHEET2
contactcountrynumber
NameANL12345678
NameBBE87654321
NameCFR45678123

<tbody>
</tbody>

SHEET3 (result)
itempricestartendcontactcountrynumber
ABC101-1-17 31-12-17NameANL12345678
DEF151-1-171-1-18NameANL12345678
GHI201-3-173-3-18NameANL12345678
ABC101-1-1731-12-17NameBBE87654321
DEF151-1-171-1-18NameBBE87654321
GHI201-3-173-3-18NameBBE87654321
ABC101-1-1731-12-17NameCFR45678123
DEF151-1-171-1-18NameCFR45678123
GHI201-3-173-3-18NameCFR45678123

<tbody>
</tbody>

If there is a simple way to realize this without a macro? if not can somebody help me out with a macro for this?

Any help is very much appreciated.

Thanks,

Martin
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,214,932
Messages
6,122,332
Members
449,077
Latest member
jmsotelo

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