PDA

View Full Version : Find / Copy & Paste Function



chacha
02-28-2008, 08:45 AM
Hi,
I can find help with code that is similar to my problem but I'm not sure about the copy part.
My problem is I have a list of numbers in Sheet1 A1:A10
I want to find these numbers in Column A of Sheet2 and copy the corresponding data in columns B,C&D to Sheet3
If the value in sheet1 does not appear in sheet2ColA i will have a MsgBox.

any help would greatly be appreciated.

Bob Phillips
02-28-2008, 09:07 AM
Just use a formula

B1: =IF(ISNA(MATCH(A1,Sheet2!A:A,0)),"",INDEX(Sheet2!A:D,MATCH(A1,Sheet2!A:A,0),COLUMN()))

and copy down and across

chacha
02-29-2008, 06:53 AM
xld, thanks, it is close to what I am looking for.
But say I have two columns of information in Sheet1, and I want to find A1.value in Sheet2ColA and then B1.value in Sheet2ColA pasting the A1 data in row one and the B1 data in row 2 of Sheet3 (then skip a line and start A2,B2+....)
Another problem I have is that the number of rows in both Sheet1 & Sheet2 varies