PDA

View Full Version : Solved: advisor name entered in one cell to auto populate their managers name in other cell



gringo287
04-14-2012, 04:48 PM
Hi


What i need is a function that will match a list of advisor names to their respective managers name so that when my pc username macro populates the user (advisor) name, in A1 the function would populate the managers name in A2.

ive had a good dig around and tried to convince myself that it must be along the lines of and INDEX/MATCH function but i cant get it to work.

any ideas?

georgiboy
04-14-2012, 10:55 PM
How about using vlookup?

Hope this helps

gringo287
04-15-2012, 06:06 AM
Hi georgiboy,

i havent set up the list/table of advisors and managers yet, as im just trying to play around with this to achieve the task first. Im pretty confident that im being really dense here and this is probably really simple, but how can i use vlookup so that i can have, say 10 different lists of a varying number of advisors that will then be linked to 10 seperate managers, so that no matter which advisors (username) name is populated in A1, that would populate their respective managers name in A2. Im very new to vba and functions, so this is puzzling me. ill attach i dummy sheet with a list of names to work from if anyone could be kind enough to give me a hand with this.

Paul_Hossler
04-15-2012, 08:32 AM
To just use VLookup, you really don't need a macro

I reformated the 2D mgr array into a 1D list, with the 'lookup value' in Col A

IMHO this is more flexible, since it's easy to add additional information (phone number, etc) , and maintenance is with worksheet formulas, which some people might prefer

Added a few more fields to demo

This could be polished of course to have better error messages, etc.

Paul

PS -- The names are not unique, so VLookup finds the first one

gringo287
04-15-2012, 11:01 AM
:cloud9: MR Hossler, i salute you. I cant believe how easy that turned out to be. I really need to get my head stuck in to some excel books.. google makes you think you have super powers and then a simple task like this, reminds me how little i actually know. Thank you.