I need a little bit help with a macro of Excel.
I need to create a macro that automatically find users and copy the values that i have in an other Sheet:
I have one sheet with values that contains the Users and their Kills and Deaths, I create 3 sheets more (3 different groups of users), and I need that the macro copy values automatically finding the users and copying values.
Images to describe it better:
----(Copy this values on)----->
If I understand what you're after, you should be able to do this with VLOOKUPs
(No VBA necessary)
The following source code solve your problem.
You don't need a macro for this, using the worksheetfunction
VLOOKUP
is sufficient.As an example, if you have your headers in row 1 and users in column A, what you'd put into cell B2 (the number of kills for the first user) would be
=VLOOKUP($A2;Values!$A$2:$C$9;2;FALSE)
and C2 would be=VLOOKUP($A2;Values!$A$2:$C$9;3;FALSE)
.The arguments for the function (which you can also find in the linked document) is:
vlookup
will only look through the first column, but since you want to return results from the other columns we include columns A:C in the formula.false
) or if an approximate one is ok (true
).