General discussion

Locked

Need excel macro to feed data from on sp

By edudley ·
I need an Excel macro that when a user inputs an employee number on the first spreadsheet it will reference a second spreadsheet, lookup the employee number, get the employee name and copy it to the correct field on the first spreadsheet.

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Need excel macro to feed data from on sp

by DKlippert In reply to Need excel macro to feed ...

You don't need a macro. Use the VLOOKUP function.
Set up the table on one sheet. (EmpID, Name, Address) Select the table and name the Range (i.e. EmpAdd).
Go back to the entry spreadsheet.
Select the results cell and enter this formula =VLOOKUP(A1,EmpAdd,2,False).
This looks at the value in cell A1 and then compares it to the values listed in the table EmpAdd. The result of the formula returns the value in the second column. The final argument, False, says to use an exact match.
Be sure to have the first column of the table sorted in ascending order.

Collapse -

Need excel macro to feed data from on sp

by edudley In reply to Need excel macro to feed ...

Thank you, worked wonderfully

Back to Windows Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums