+ Reply to Thread
Results 1 to 13 of 13

Assign an agent to customer based on language and loop - VBA

  1. #1
    Registered User
    Join Date
    04-10-2015
    Location
    Manchester, England
    MS-Off Ver
    2013
    Posts
    11

    Assign an agent to customer based on language and loop - VBA

    Good morning,
    I'm trying to find some help, hope it's the right place :-)

    I have 2 sheets -
    On the first (Customers) - I have a list of customers that i need to call them back (including their language).
    On the second (Agents) - I have a list of agents with their language skills.

    I want to create a macro that will 'assign' an agent to each customer based on the language,
    In most cases i will have more customers than agents and i want to loop the agents based on their language.
    (The yellow part in the attached document is what i'm aiming for).

    Example.xlsm

    The process is much longer but i'm struggling only with that part at the moment.

    Thanks a lot!

    Ori

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,097

    Re: Assign an agent to customer based on language and loop - VBA

    In case there is 2 Agents for the same language, after selection of the first one we have to pick up the second one ?
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    04-10-2015
    Location
    Manchester, England
    MS-Off Ver
    2013
    Posts
    11

    Re: Assign an agent to customer based on language and loop - VBA

    Hi PCI,
    Yes, there may be only 5 agents for the same language but 10 customers, i want to assign the agents in a way that each agent will have 2 customers in that case:
    Customer 1 - Agent 1
    Customer 2 - Agent 2
    Customer 3 - Agent 3
    Customer 4 - Agent 4
    Customer 5 - Agent 5
    Customer 6 - Agent 1
    Customer 7 - Agent 2
    Customer 8 - Agent 3
    Customer 9 - Agent 4
    Customer 10 - Agent 5

    Thanks

  4. #4
    Registered User
    Join Date
    04-10-2015
    Location
    Manchester, England
    MS-Off Ver
    2013
    Posts
    11

    Re: Assign an agent to customer based on language and loop - VBA

    Any ideas? please?

  5. #5
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,097

    Re: Assign an agent to customer based on language and loop - VBA

    I'm working on, and it takes me some time.
    Certainly today will be good.

  6. #6
    Registered User
    Join Date
    04-10-2015
    Location
    Manchester, England
    MS-Off Ver
    2013
    Posts
    11

    Re: Assign an agent to customer based on language and loop - VBA

    Aww..cool!!
    I'm sorry, I wasn't sure if someone is working on it...

    Thank you :-)

  7. #7
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,097

    Re: Assign an agent to customer based on language and loop - VBA

    Here we are, try and comment
    Column "E" in sheet "Customers" is filled
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by PCI; 08-21-2015 at 09:21 AM. Reason: Typo

  8. #8
    Registered User
    Join Date
    04-10-2015
    Location
    Manchester, England
    MS-Off Ver
    2013
    Posts
    11

    Re: Assign an agent to customer based on language and loop - VBA

    You are amazing!!!!!

    I found only one issue - When i have the same language repeating more times than the amount of agents, the same agent will appear twice in a row.

    For example, for Spanish customers, from the fourth customer the code will assign the first agent again:

    Customer: Agent:
    First Customer - Daniel
    Second Customer - Maxim
    Third Customer - Daniel
    Fourth Customer - Daniel (again)

    The example file attached here - Example2.xlsm

    In the actual list i have thousands of customers and hundreds of agents in many more languages, i'm trying to divide the customers equally if possible...

    Thanks a lot again!! Much appreciated!

  9. #9
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,097

    Re: Assign an agent to customer based on language and loop - VBA

    Clear there is an issue.
    Can we have more than 2 Agents per language ?

  10. #10
    Registered User
    Join Date
    04-10-2015
    Location
    Manchester, England
    MS-Off Ver
    2013
    Posts
    11

    Re: Assign an agent to customer based on language and loop - VBA

    Yes, we can have a lot of customers and a lot of agents per each language, depends on the hour of the day
    (This macro will be the next step after my first report that tells me who is currently in the business).

    Generally the full process will be:
    1. Identify who is in the business (agents)
    2. Identify which customers are waiting for a call back (Customers)
    3. Assign online agents to customers
    4. Send an email to the agents with the customer details
    5. Keep a record with all the data (for tracking)

    I'm building each part separately and i already have the most of it, just need to do some fixes and combine them.

    Thanks

  11. #11
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,097

    Re: Assign an agent to customer based on language and loop - VBA

    Here a remake
    Please Login or Register  to view this content.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    04-10-2015
    Location
    Manchester, England
    MS-Off Ver
    2013
    Posts
    11

    Re: Assign an agent to customer based on language and loop - VBA

    Perfect! you are genius!!
    I will try it wish some real data on Monday and let you know :-)

    Thank you very much and have a great weekend!!

    Ori

  13. #13
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,097

    Re: Assign an agent to customer based on language and loop - VBA

    Good news.
    Happy week end to you
    Patrick

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Loop thru a customer list and go to their shhet and insert data
    By a86jag in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-18-2014, 09:39 PM
  2. Replies: 1
    Last Post: 02-28-2014, 03:38 PM
  3. Loop: Assign value to Cell based on List
    By hamidxa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-16-2013, 12:38 AM
  4. More efficient way to loop through cells and assign values
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 40
    Last Post: 08-29-2013, 05:54 AM
  5. Replies: 3
    Last Post: 04-23-2013, 03:46 PM
  6. [SOLVED] VBA loop to copy a worksheet a number of times, assign name each time based on loop number
    By TBG in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-29-2012, 10:54 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1