+ Reply to Thread
Results 1 to 2 of 2

VBA to create 2 teams by Skill and Position

Hybrid View

tsr123 VBA to create 2 teams by... 05-13-2019, 10:25 AM
Bernie Deitrick Re: VBA to create 2 teams by... 05-13-2019, 03:22 PM
  1. #1
    Registered User
    Join Date
    05-13-2019
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    1

    VBA to create 2 teams by Skill and Position

    Hi I am looking to create a random team generator by 2 variables, skill and position.

    Was either thinking like the below and then some VBA to split into two teams and ensuring the positions are as evenly split as poss, i.e. in the case there may be more DEF than ATT

    Player Rating Position
    Player1 5 GK
    Player2 9 DEF
    Player3 7 ATT
    Player4 6 DEF
    Player5 5 ATT
    Player6 7 GK
    Player7 3 DEF
    Player8 7 ATT
    Player9 8 DEF
    Player10 6 ATT
    Player11 8 ATT
    Player12 5 DEF
    Player13 6 ATT
    Player14 7 DEF

    Or

    An Attack and Defense Rating but flagging two as GK's to ensure they are on two different teams

    Player Attack Rating Defense Rating GK
    Player1 5 8 x
    Player2 9 6 x
    Player3 7 8
    Player4 6 5
    Player5 5 6
    Player6 7 7
    Player7 3 5
    Player8 7 9
    Player9 8 7
    Player10 6 6
    Player11 8 5
    Player12 5 7
    Player13 6 3
    Player14 7 7


    Any ideas would be massively appreciated

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,304

    Re: VBA to create 2 teams by Skill and Position

    VBA is not really needed for this.

    Sort by Position, then by skill. For the Keepers, use Team B, then Team A For the Attackers, use A B B A and repeat for however many players you have - and for the defenders, use B A A B and repeat. This will pair the 1st and 4th most skilled, and the 2nd with the 3rd, attackers; paired with the 2nd with the 3rd, and the 1st and 4th most skilled defenders.
    Bernie Deitrick
    Excel MVP 2000-2010

+ 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] Create Teams of 4 or 3 Players
    By MarvinP in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-29-2019, 10:23 AM
  2. [SOLVED] Create Teams Taking So Long Now
    By xjohnson in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-14-2018, 05:53 PM
  3. Replies: 6
    Last Post: 08-11-2017, 08:47 PM
  4. randomly create schedule for 10 teams
    By hopefulhart in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-03-2015, 12:56 AM
  5. [SOLVED] Use a table to create teams
    By jimboryan in forum Excel General
    Replies: 10
    Last Post: 06-03-2014, 06:07 PM
  6. Create different teams accordind the number of them
    By deniseb27 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-23-2014, 08:50 PM
  7. Can you create balanced teams?
    By paseo in forum Excel General
    Replies: 3
    Last Post: 11-07-2012, 12:45 PM

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