Copy rows based on parameters

N

npop03

Hello all, I am trying to find a way that will allow me to copy an entire row
of data from one sheet to another based on matching values. Hard to explain,
see below.

Sheet 1 Sheet 2
A B C A B C
1 a 1 2 1 b 3 4
2 b 3 4 2 c 5 6
3 c 5 6 3 a 1 2

So, if on Sheet 2, column A has a "b", it will find "b" in Sheet 1 (only in
column A) and copy the entire row from Sheet 1 to Sheet 2.

Further info, there may be values in Sheet 2 that will not match what is in
Sheet 1, in that case I would like those cells to remain blank. Thank you for
the help!
 
L

Luke M

Might I suggest using a formula instead?

In B1
=IF(ISNUMBER(MATCH($A1,'Sheet1'!$A:$A,0)),INDEX('Sheet1'!B:B,MATCH($A1,'Sheet1'!$A:$A,0)),"")

You can then copy down/across as needed. If a formula won't work, you'll
have to use a macro/VB.
 
N

npop03

That does the trick!

Thanks a million,

npop03

Luke M said:
Might I suggest using a formula instead?

In B1:
=IF(ISNUMBER(MATCH($A1,'Sheet1'!$A:$A,0)),INDEX('Sheet1'!B:B,MATCH($A1,'Sheet1'!$A:$A,0)),"")

You can then copy down/across as needed. If a formula won't work, you'll
have to use a macro/VB.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top