+ Reply to Thread
Results 1 to 19 of 19

Macro to generate groups randomly of 20 numbers, being 10 of group A and 10 of group B,

  1. #1
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    2,175

    Macro to generate groups randomly of 20 numbers, being 10 of group A and 10 of group B,

    Macro = to generate groups randomly of 20 numbers, being 10 of group A and 10 of group B, without polindromos,
    Ok we have two groups = A and B, 45 numbers of each group, the 20 numbers generated
    Can not have the couple reversed in the example group if it has 32 can not have 23 if it has 75 can not have 57. ... etc, within the group of 20 numbers 10 and 10 can not have the couple polindromo
    Objective To generate more than 2000 (two thousand) lines of 20 interleaved numbers 10 to 10 groups A and B
    Without the couple reversed.
    Ex = 02 15 32.62 72 68 29 10 ..... 20 numbers
    01 02 03 04 05 06 07 08 09 12 13 14 15 16 17 18 19 23 24 25 26 27 28 29 34 35 36 37 38 39 45 46 47 48 49 56 57 58 59 67 68 69 78 79 89 =group A
    10 20 21 30 31 32 40 41 42 43 50 51 52 53 54 60 61 62 63 64 65 70 71 72 73 74 75 76 80 81 82 83 84 85 86 87 90 91 92 93 94 95 96 97 98= group B
    Last edited by AliGW; 11-13-2017 at 09:16 AM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Macro = to generate groups randomly of 20 numbers, being 10 of group A and 10 of group

    Will you please attach a SMALL sample Excel workbook(s) (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. (If trere are typical cases like: all unique values/duplicates could occur, day/night, nobody present/several persons at once, before/on/past due, etc. - please show them all or at least indicate in text) The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution(s) is/are also shown (mock up the results manually).

    3. Make sure that all confidential/restricted information (either personal or business) like real e-mails, social security numbers, bank accounts, etc. is removed first!!

    To attach an Excel file you have to do the following: Just before posting, scroll down and press Go Advanced button and then scroll down and press Manage Attachments link. Now follow the instructions at the top of that pop-up screen.
    Best Regards,

    Kaper

  3. #3
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    2,175

    Re: Macro = to generate groups randomly of 20 numbers, being 10 of group A and 10 of group

    Ok kaper, but may not need sample attachment =
    Look, we have two groups a and b
    The macro takes 10 numbers from one group and 10 from the other groups without being inverted couple
    It's just this
    * Example =
    02 20 45 54 96 69 .... can not, exclude why the couple has polindromo
    02 45 96 = yes, because the couple does not have polindromo
    It is easy in the 20 numbers generated 10 of group a and 10 of group b
    * There can be no pair polindomo
    * What is the doubt?

  4. #4
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    2,175

    Re: Macro = to generate groups randomly of 20 numbers, being 10 of group A and 10 of group

    hello KAPER=https://www.excelforum.com/attachment.php?attachmentid=547450&stc=1&d=1510572348
    Attached Files Attached Files

  5. #5
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Macro = to generate groups randomly of 20 numbers, being 10 of group A and 10 of group

    Would for instance:
    1 2 3 4 5 6 7 8 9 12
    31 32 41 42 43 51 52 53 54 61
    Be OK?

  6. #6
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    2,175

    Re: Macro to generate groups randomly of 20 numbers, being 10 of group A and 10 of group B

    yes, yes, correct! kaper

  7. #7
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    2,175

    Re: Macro to generate groups randomly of 20 numbers, being 10 of group A and 10 of group B

    Hello kaper ok you have to generate more than 2000 formations as presented
    You can?

  8. #8
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Macro to generate groups randomly of 20 numbers, being 10 of group A and 10 of group B

    Very Clunky, but perhaps something along the lines of the attached
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    2,175

    Re: Macro to generate groups randomly of 20 numbers, being 10 of group A and 10 of group B

    Ohh! Perfect, DAVSTH, very good job, congratulations, it works well, artwork !!! A thousand thanks. thank you

  10. #10
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    2,175

    Re: Macro to generate groups randomly of 20 numbers, being 10 of group A and 10 of group B

    Ok DAVSTH!so one question the macro got all or 45 numbers from each group? ,

  11. #11
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    2,175

    Re: Macro to generate groups randomly of 20 numbers, being 10 of group A and 10 of group B

    Hello, if I want you to be on the same line
    17 48 83 63 14 26, ..... 20 are three numbers from each group
    Have they got together?
    All sets from 01 to 12 as initial numbers have as
    Swing inside the two groups?

  12. #12
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    2,175

    Re: Macro to generate groups randomly of 20 numbers, being 10 of group A and 10 of group B

    Hello, we have a problem here, you have to merge (mix) all 45 numbers from group a to b, without the couple reversed. This event that every line starts with 01 to 12
    In a line of 20 you have to work with all 45 in group a with all 45 in b
    * Unmatched polindromo, please

  13. #13
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    2,175

    Re: Macro to generate groups randomly of 20 numbers, being 10 of group A and 10 of group B

    Hello, we have a problem here, you have to merge (mix) all 45 numbers from group a to b, without the couple reversed. This event that every line starts with 01 to 12
    In a line of 20 you have to work with all 45 in group a with all 45 in b
    * Unmatched polindromo, please

  14. #14
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Macro to generate groups randomly of 20 numbers, being 10 of group A and 10 of group B

    We advise you not to 'bump' (reply to) your own posts too quickly after posting, unless you are posting some sort of clarification. If you do bump, limit it to no more than once every day. Remember that your best helper may be asleep on the other side of the world.

  15. #15
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Macro to generate groups randomly of 20 numbers, being 10 of group A and 10 of group B

    I am not understanding any of your questions, post an example of what you want.

  16. #16
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    2,175

    Re: Macro to generate groups randomly of 20 numbers, being 10 of group A and 10 of group B

    Let's DAVSTH modify a bit okay, let's generate a number from each group
    * Generating 40 formations now, you do not need to open another topic
    Each color has 4 letters 4 numbers, generate formations only one number from each group
    Without the couple reversed ok
    https://www.excelforum.com/attachmen...1&d=1510658880
    Attached Files Attached Files

  17. #17
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Macro to generate groups randomly of 20 numbers, being 10 of group A and 10 of group B

    This is DIFFERENT question and is only a bit related to original one.

    It does not help users who use search tools to find solution for their problems if you change subject of the question within the thread.

    So with a new question start a new thread. In this new thread, while posting attachment, please insert representative set of input data and representative output expected.
    Last edited by Kaper; 11-14-2017 at 08:00 AM.

  18. #18
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    2,175

    Re: Macro to generate groups randomly of 20 numbers, being 10 of group A and 10 of group B

    Ok, it changes a little, what should I do?

  19. #19
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Macro to generate groups randomly of 20 numbers, being 10 of group A and 10 of group B


+ 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. Randomly assign to a group with a maximum group size
    By sunsoar77 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-25-2016, 09:18 PM
  2. [SOLVED] (VBA) How Assign Column Cell To Corresponding Group, and Paste Group Cells into Groups WS?
    By eryksd in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-08-2016, 06:18 PM
  3. Replies: 7
    Last Post: 11-05-2014, 04:23 AM
  4. Group numbers into groups
    By arajkum in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-12-2013, 02:47 PM
  5. [SOLVED] Randomly group N elements (where N is a factor of 7) into groups of 7
    By nomadic23 in forum Excel General
    Replies: 14
    Last Post: 10-10-2013, 06:07 AM
  6. Macro to scan through groups of combinations for numbers not in the group
    By flexalong in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-09-2009, 11:44 PM
  7. Program to randomly selecting numbers from a group of numbers
    By flexalong in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-27-2008, 04:22 AM

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