Compare 2 workbooks and copy data

Steffmeister

Board Regular
Joined
Nov 7, 2005
Messages
195
Hi guys,

I got a question and maybe somebody can help me?
I got some addresses in a sheet. I want to compare these addresses with another workbook (QIP.xls). This workbook exists of a few sheets with addresses and got data till column E.
Now I’d like to have the data from workbook QIP.xls into the worksheet with the addresses I’d like to compare. Does somebody know a macro for this?

Grts. Steffmeister :)
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Do you want to take the data from the sheets in QIP.xls and stack them on top of each other in your first spreadsheet so you can do a vlookup or something

or

Do you want to do some sort of lookup in the sheets and only copy across the data that matches?
 
Upvote 0
gingerafro said:
Do you want to take the data from the sheets in QIP.xls and stack them on top of each other in your first spreadsheet so you can do a vlookup or something

or

Do you want to do some sort of lookup in the sheets and only copy across the data that matches?

Hi Gingerafro,

The addresses in the first spreadsheet must be compared with the QIP.xls addresses and the data of QIP.xls must be copied in the first spreadsheet. So the second solution what you said is what I tried to explain :biggrin:.
 
Upvote 0
When you say addresses, is this a postal address extending over several cells or another type of address in just one cell.

Would a vlookup work (ie is the data in one cell exactly the same as QIP.xls)

How many sheets are there?

How much of the data do you want to copy (columns A to E, I expect?)
 
Upvote 0
gingerafro said:
When you say addresses, is this a postal address extending over several cells or another type of address in just one cell.

Would a vlookup work (ie is the data in one cell exactly the same as QIP.xls)

How many sheets are there?

How much of the data do you want to copy (columns A to E, I expect?)

They are IP-addresses so the data is exact the same.
There are 5 sheets in QIP.
I'd like to copy column A to E pls.
 
Upvote 0
Unless you are doing this regularly, I would personally do it manually with vlookups.

1. Do a vlookup on the first sheet and return column A only. I anticipate that you have a lot of data so wouldn't recommend doing all 5 colums at once.
2. Sort by the column you have just returned (sending all N/As to the bottom.
3. Redo the vlookup for the rest of the columns on the values that you know you have matches for.
4. Go to the next sheet and start again.

If you can write vlookup formulas, this process would take no longer than 20 minutes, and be a lot less complicated than writing a macro!!
 
Upvote 0
Hi Gingerafro,

Tnx for the advice, but I must do a few 100 addresses every week. So maybe a macro is faster and smoother then?
Hope you can help me?

Tnx
 
Upvote 0
I think that the method I posted will work for you (although I am obviously working blind on this), and if you want to have a macro, I would start by using the macro recorder.

If you've not used the macro recorder before, then the best advice is to sit and think about what you are going to do before you do it. Everytime you perform an action with the recorder turned on, puts something into your macro. Its not dangerous, just makes editing messy.

So, in summary.
Do the job you want to do manually first without the recorder on so you know the method exactly.
Record a macro whilst doing the task manually.
Edit the vba to make it less messy, possibly quicker and (and I think you'll need this for what you are doing) more intuitive.

If you would like help with part 3. post the recorded macro on and i can see what you have done. It'll also help with understanding your method.
 
Upvote 0

Forum statistics

Threads
1,214,782
Messages
6,121,532
Members
449,037
Latest member
tmmotairi

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