+ Reply to Thread
Results 1 to 5 of 5

random generator

  1. #1
    Registered User
    Join Date
    04-04-2012
    Location
    Kampala
    MS-Off Ver
    Excel 2011
    Posts
    4

    random generator

    I have a list of 500 names in CSV, i want to have a visual basic graphic code or a macro that can help me select 5 winners of these

  2. #2
    Forum Contributor Russell Dawson's Avatar
    Join Date
    03-01-2012
    Location
    Yorkshire, England
    MS-Off Ver
    2007
    Posts
    608

    Re: random generator

    =INT(RAND()*(500-1)+1)

    copied into 5 cells could do it

    F9 to change
    Last edited by Russell Dawson; 04-04-2012 at 04:08 AM.
    If I helped, please don't forget to add to my reputation. (click on the star below the post)

    If the problem is solved, please: Select Thread Tools (on top of your 1st post) -> Mark this thread as Solved.

    Failure is not falling down but refusing to get up.

  3. #3
    Registered User
    Join Date
    04-04-2012
    Location
    Kampala
    MS-Off Ver
    Excel 2011
    Posts
    4

    Re: random generator

    hi, when i copy that they are times when i get duplicates, how do i avoid this, plus i need the results of each F9 return to be stored somewhere

  4. #4
    Forum Contributor Russell Dawson's Avatar
    Join Date
    03-01-2012
    Location
    Yorkshire, England
    MS-Off Ver
    2007
    Posts
    608

    Re: random generator

    Not sure to be honest. To do it fully I as you state I would expect you need some VBA. It's probably best to retitle your question "VBA for random generator" and move it to the "Excel programming" forum.

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: random generator

    use rand .then unique rank the rand. then match 1,2,3,4,5 in an index heres an excample with just the first 50 names ,extend to 500 in yours
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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