Need to copy rows based on values entered

[Closed]
Report
-
Posts
2809
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
September 23, 2021
-
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 reply

Posts
2809
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
September 23, 2021
484
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