Compare Values in 2 columns and Copy the entire row upon match

1. Compare Values in 2 columns and Copy the entire row upon match

Hello

I have 2 worksheets, WS1 & WS2:
WS1 has 1 column (with total 41253 rows) & WS2 has 3 columns (with total 25938 rows)

I am trying to write a formula (or a macro) to take each value in WS1 and lookup in first col (Column A ) in WS2 - and if i find it copy that particular entire row from WS2 and paste it in a new sheet (lets call it WS3) and continue to do so to the rest in WS1

with an end result of 41253 rows and 3 columns in WS3

(see attachment)

Hopefully you help me with this.

2. Re: Compare Values in 2 columns and Copy the entire row upon match

1) Select Sheet 1
2) Right Click Sheet tab and slect to copy sheet
3) The new copy is going to be the new sheet3

4) The values in column A of new sheet are Strings while in Sheet 2 are numbers so
we must convert them to numbers so that vlookup will work
4b) in an empty cell type the number 1
4c) select the cell with number one and rt click and select copy
4d) select all of column 1 , of new sheet, and rt click and select paste special
4e) in select special window select "value" AND "multply"
4f) clicking OK will turn strings to numbers

5) New sheet Column B formula =VLOOKUP(\$A2,Sheet2!\$A:\$C,2,FALSE)
6) New Sheet Column C formula =VLOOKUP(\$A2,Sheet2!\$A:\$C,3,FALSE)

7) Sort by column B to put all n/a's together ... and delete them

3. Re: Compare Values in 2 columns and Copy the entire row upon match

nimrod ... it works like a charm.
Thanks so much for the response !!!
Appreciate all the support ! (not sure how i can repay back !!)

4. Re: Compare Values in 2 columns and Copy the entire row upon match

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1