+ Reply to Thread
Results 1 to 5 of 5

Random List with input number from a selection list

  1. #1
    Registered User
    Join Date
    11-26-2012
    Location
    sg
    MS-Off Ver
    Excel 2003
    Posts
    2

    Random List with input number from a selection list

    Dear all,
    I'd like to create, says, there are 100 student name list sheet, and enter at a cell (e.g. at E1 cell), say, 5 and then if i click 'Result' icon, the another (result) sheet show random of 5 students name should appear (of cause these 5 names cannot be repeated in the result). And next day, need to choose 3 and click 'Result' it would show 3 name at result sheet

    Student List sheet
    Joe
    John
    Amy
    Andy
    Kim
    Foster
    ... total 100

    Please kindly help to advice. Thanks!
    alex

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Random List with input number from a selection list

    Hi
    try this worksheet
    it assumes your names are in cells A1:A100 on sheet "names"
    adjacent to these I have added a column of random numbers that is used to sort the names column
    the macro sorts the names randomly, then takes the first N names from the list, where N is in cell B1 in sheet "random select",
    then types the first N names into successivce cells starting at cell A4 on sheet "random select"
    the button on sheet "random select" runs the macro, or you can run it directly from the macro area. It is called select_names

    If you have a problem using the random number column to sort let me know - there are other ways to do this if needed (though not so simple)
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Random List with input number from a selection list

    hi alexaktung, welcome to Excelforum, option
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: Random List with input number from a selection list

    Hi,

    I know others have answered already, but here's my version anyway. I used a function made by Chip Pearson, so thanks to him!

    edit: X in column B means that the name has already been selected once and it won't be selected again. Delete the X to be able to select that name again.
    Attached Files Attached Files
    Last edited by RHCPgergo; 11-26-2012 at 06:16 AM.

  5. #5
    Registered User
    Join Date
    11-26-2012
    Location
    sg
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Random List with input number from a selection list

    Hi NickyC and watersev,
    Thank you very much for your very quick response!
    For NickyC, yes i encounter error @ SortFields.Clear method but it work perfactly fine with watersev solution.
    Again, thank you very much both of you for your kind help. Cheers!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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