+ Reply to Thread
Results 1 to 15 of 15

Group draw as specific repetition

  1. #1
    Registered User
    Join Date
    03-30-2017
    Location
    Brazil
    MS-Off Ver
    2019
    Posts
    54

    Post Group draw as specific repetition

    Hi folks,

    I would like help with a small project that I am creating for a name draw worksheet (groups of three).

    I need to draw groups of 3 people from a list and insert these groups one below the other as I click the button to perform the draw.
    1.PNG

    A detail: Names cannot be repeated in the draws. In cell B3 I entered a value, which I would like the names to repeat only after this amount of drawings.

    I did a search on the internet, but I didn't find anything like that for group draw, I just found the use of the RAND function for group draw.

    Could someone help me with this task?

    Thank you in advance
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,454

    Re: Group draw as specific repetition

    This will require VBA - shall I move the thread for you?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    03-30-2017
    Location
    Brazil
    MS-Off Ver
    2019
    Posts
    54

    Re: Group draw as specific repetition

    Yes please.
    Sorry for posting in the wrong location.

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi ! Try this demonstration !


    According to your attachment as a VBA beginner starter :

    PHP Code: 
    Sub Demo1()
        
    Dim VR&, N&, W
            V 
    Sheets("Names").UsedRange.Value2
            Randomize
        
    For UBound(VTo UBound(V) \ 4 Step -1
            N 
    Fix(Rnd R) + 1
            W 
    V(R1):  V(R1) = V(N1):  V(N1) = W
        Next
            
    [E2].Resize((UBound(V) \ 3) * 3).Value2 V
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !
    Last edited by Marc L; 06-27-2020 at 12:15 PM. Reason: optimization …

  5. #5
    Registered User
    Join Date
    03-30-2017
    Location
    Brazil
    MS-Off Ver
    2019
    Posts
    54

    Re: Hi ! Try this demonstration !

    Quote Originally Posted by Marc L View Post

    According to your attachment as a VBA beginner starter :

    PHP Code: 
    Sub Demo1()
        
    Dim VR&, N&, W
            V 
    Sheets("Names").UsedRange.Value2
            Randomize
        
    For UBound(VTo UBound(V) \ 4 Step -1
            N 
    Fix(Rnd R) + 1
            W 
    V(R1):  V(R1) = V(N1):  V(N1) = W
        Next
            
    [E2].Resize((UBound(V) \ 3) * 3).Value2 V
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !
    Perfect Marc!
    Thanks for your help.

    Would it be possible to insert only 3 names drawn at a time in the list?

    Example: I click on the button and 3 names are added to the list (E2: E4). I click the button again and 3 other names drawn are inserted in the list below the first draw (in E5: E7). And so on, repeating the names only according to the value of the round entered in cell B3.

    Thank you.

  6. #6
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Group draw as specific repetition


    The easy way to avoid any repetition and a 'gas factory' code is to draw 3 x B3 cell at a time so 24 names …

  7. #7
    Registered User
    Join Date
    03-30-2017
    Location
    Brazil
    MS-Off Ver
    2019
    Posts
    54

    Re: Group draw as specific repetition

    How would that work?

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,454

    Re: Group draw as specific repetition

    Administrative Note:

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. No help to be offered until the link is provided.)

  9. #9
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Re: Group draw as specific repetition


    Exactly the same beginner starter just allocating obviously the first 24 names from the array rather than all the array !

    For each new 24 names draw, column E should be cleared or the new draw is allocated after the last one ?

  10. #10
    Registered User
    Join Date
    03-30-2017
    Location
    Brazil
    MS-Off Ver
    2019
    Posts
    54

    Re: Group draw as specific repetition

    Thank you!

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,454

    Re: Group draw as specific repetition

    Administrative Note:

    Sorry, but your post does not comply with Rule #6 of our Forum RULES:

    Please do not ignore requests by Administrators, Moderators and senior forum members regarding forum rules.

    If you are unclear about the request or instruction, then send a private message to them asking for clarification.

    All Participants:

    Please do not post a reply in a thread where a Moderator or Administrator has requested an action that has not yet been complied with (e.g. title change, code tags requested, etc.). Thanks.

  12. #12
    Registered User
    Join Date
    03-30-2017
    Location
    Brazil
    MS-Off Ver
    2019
    Posts
    54

    Re: Group draw as specific repetition

    Sorry about that.
    Last edited by AliGW; 06-28-2020 at 09:26 AM. Reason: Please don't quote unnecessarily!

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,454

    Re: Group draw as specific repetition

    Where is the cross-post link I have requested? You still need to provide it.

  14. #14
    Registered User
    Join Date
    03-30-2017
    Location
    Brazil
    MS-Off Ver
    2019
    Posts
    54

    Re: Group draw as specific repetition


  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,454

    Re: Group draw as specific repetition

    Thank you.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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] detect number repetition * from the last draw to the next,
    By jorel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-06-2019, 09:16 AM
  2. Macro to Group, Label and draw borders
    By johnmitch38 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-10-2016, 01:42 PM
  3. [SOLVED] Draw red circles in specific columns
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-27-2015, 06:24 PM
  4. draw multi Arc in in one group
    By DOSSFM0Q in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-26-2014, 07:22 AM
  5. draw multi Arc in in one group
    By DOSSFM0Q in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-18-2014, 07:12 PM
  6. [SOLVED] Conditional Format to draw top and bottom borders at first and last of a group of text
    By jojo101 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-21-2013, 02:17 AM
  7. Group button on draw toolbar greyed out
    By jtpryan in forum Excel General
    Replies: 0
    Last Post: 02-28-2013, 09:38 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