Compare and copy name

sprit36

New Member
Joined
May 16, 2017
Messages
12
Good morning, in the attached example, on sheet2, I have a database with the employee number and name, on sheet1 I need a macro that compares column A of sheet 1 with that of sheet 2 and in sheet 1 in name, put the name of the employee. Thank you
 

Attachments

  • Sheet1.JPG
    Sheet1.JPG
    35.9 KB · Views: 8
  • Sheet2.JPG
    Sheet2.JPG
    26.3 KB · Views: 8

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Are you sure you need a macro? That can be done with a basic INDEX/MATCH. Put this in B2 on Sheet1, and drag down as needed:

Excel Formula:
=INDEX(Sheet2!$A$2:$A$5,MATCH(A2,Sheet2!$B$2:$B$5,0))
 
Upvote 0
Solution

Forum statistics

Threads
1,215,232
Messages
6,123,768
Members
449,122
Latest member
sampak88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top