Need to copy rows based on values entered

Closed
JCW - Mar 21, 2012 at 10:21 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Mar 22, 2012 at 11:26 AM
Hello,

I need help with a formula or macro. My situation is this: I have one sheet of data (Sheet1) with unique values (item numbers) in Column A. In Sheet2 I'd like to be able to enter item numbers down Column A and run a formula/script that will then find that row in Sheet1 and copy it to Sheet2 (into the same row that the item number was entered into in Sheet2).

Both sheets will contain column headings in Row 1 and be formatted the same.

Any help would be greatly appreciated.


1 response

TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 552
Mar 22, 2012 at 11:26 AM
Hi JCW,

Take a look at the following formula in B2 of sheet2:
=VLOOKUP($A$2;Blad1!A2:C8;2;0)

It will find the value entered in sheet2 A2 in the range A2:C8.
When found it will return the value in column 2 of the range.
The final 0 in the formula makes sure that the values are matching.

A2 in the formula is an absolute cell reference, meaning that when you drag the formula the reference remains the same.

Now drag the formula to the right and as far as needed and for each following column change the 2 into a 3 then a 4 and so on....

Now that you understand the formula, you can adjust it to make it work correctly for you.

Good luck and best regards,
Trowa
0