Hi All -
I'm desperately hoping someone has the solution for what I'm trying to do here. Posting on mobile, so apologies in advance for not having code to paste outright.
I have two worksheets in my workbook, one titled teams and the other data. On sheet 'teams' I have a listing of agents and supervisors. Sups are listed starting at B1 through Y1, with their respective agents populating cells B2:Y32. Any agent in column B reports to the Sup in B1, etc.
Sheet 'data' contains something like 89000 rows of data about each individual...each agent name populating rows A2:A89000.
I need code to run a macro that looks at cell A2, looks that value (name) up in the array on sheet 'teams', and based on the column the value is found in, returns the value of that column, row 1 to sheet 'data', P2. Then I need the script to do that for every row on sheet 'data'. I have 25 Sups. 400 agents. And teams change monthly. So doing it manually or with a find/replace in the sheet itself MIGHT cause me to jump from a very high place.
I pray someone out there has the solution for this...I've tried every combination of if/then, v and h lookups, find/match, etc...I'm stuck.
I'm desperately hoping someone has the solution for what I'm trying to do here. Posting on mobile, so apologies in advance for not having code to paste outright.
I have two worksheets in my workbook, one titled teams and the other data. On sheet 'teams' I have a listing of agents and supervisors. Sups are listed starting at B1 through Y1, with their respective agents populating cells B2:Y32. Any agent in column B reports to the Sup in B1, etc.
Sheet 'data' contains something like 89000 rows of data about each individual...each agent name populating rows A2:A89000.
I need code to run a macro that looks at cell A2, looks that value (name) up in the array on sheet 'teams', and based on the column the value is found in, returns the value of that column, row 1 to sheet 'data', P2. Then I need the script to do that for every row on sheet 'data'. I have 25 Sups. 400 agents. And teams change monthly. So doing it manually or with a find/replace in the sheet itself MIGHT cause me to jump from a very high place.
I pray someone out there has the solution for this...I've tried every combination of if/then, v and h lookups, find/match, etc...I'm stuck.