VBA MAcro for integrating one dokument in another

Sara85

New Member
Joined
Nov 4, 2009
Messages
2
Hello,

I'm a beginner in the VBA jungle, I really need help!
I have one workbook containing customer namnes, customer codes and more. The other workbook containes the same names but different information. What I whant to do is to take the information from the second workbook and integrate that in the first workbook. I´ll show you with a small examle:

Workbook1:
Customer Names Year of birth Country
Sara 1978 US
Charlie 1982 Canada
Julie 1986 Poland

Workbook2:
Customer Name Zipcode
Sara 89652
Julie 89523

The result should look like this:
Customer Names Year of birth Country Zipcode
Sara 1978 US 89652
Charlie 1982 Canada No data
Julie 1986 Poland 89523
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
You don't need VBA - just a slightly complicated formula. HLOOKUPS etc should be avoided as they need data in order.

Assuming they start at $A$2 with titles in row 1:

In Workbook 1, in the Zipcode column, put this:
=OFFSET('workbook2'!$B$1,MATCH($A2,'workbook2'!$A:$A,0),0)
 
Upvote 0
Thank you for your time!

But it doesen't work, some of the names are not spelled exactly the same. Can I use vlookup or something else?

BR
 
Upvote 0
If the names aren't spelt the same, a VLOOKUP wouldn't work either.

The only way will be to use the INDEX function, where you have a column where you can type in the row of the name in the second sheet. But if you've 10,000 rows that's probably not feasible!
 
Upvote 0

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