+ Reply to Thread
Results 1 to 5 of 5

Prize Draw with Macro

  1. #1
    Registered User
    Join Date
    02-24-2014
    Location
    New Zealand
    MS-Off Ver
    Excel 2013
    Posts
    4

    Thumbs up Prize Draw with Macro

    Hi Guys

    I'm trying to get a random prize draw working with in excel. My worksheet structure as follows.

    A1 person's name
    B2 points obtain by the person.

    A1 B2
    John 10 points
    Ken 20 points
    Amy 30 points

    1st draw. If random number result between 1 and 10 display John wins then delete John's entries.
    2nd draw etc... and delete anyone that has already won a prize.


    With the following code I found on this forum it partly works. It only randomly select a cell but missing displaying the winner and removing it afterwards. Any help will be appreciated.

    Sub random()

    Dim rng As Range

    Set rng = Range("a1:a180")

    rng.Cells(Int(Rnd * rng.Cells.Count) + 1).Select


    End Sub
    Last edited by sacen; 04-17-2014 at 03:40 AM.

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Prize Draw with Macro

    Please use code tags when posting. See if you can use this?
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    02-24-2014
    Location
    New Zealand
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: Prize Draw with Macro

    Hi John

    Thanks, sorry I'm a novice in macros. How dose your file work I don't see any macros scripts on it ?

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Prize Draw with Macro

    Sorry, I have 2003. You 2013. You probably lost the code on conversion. Here is the code.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-24-2014
    Location
    New Zealand
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: Prize Draw with Macro

    Thanks John.

    Is it possible to disable generating the random number at the start ? I have a fixed number of entries eg:

    John: 5 entries
    Mark: 10 entries
    Amy: 20 entries

    So if the randomly selected number between 1-5 winner is John or if selected number between 6-10 Winner is Mark and if between 11-20 Amy is the winner and so on but it will only select 5 winners from the list.

    I have attached my work file to show what I meant. Do I make sense?

    Attached Files:
    Last edited by sacen; 04-23-2014 at 07:12 PM.

+ 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. Prize Won - Count of Prize
    By vinaynaran in forum Excel General
    Replies: 2
    Last Post: 07-31-2009, 09:13 AM
  2. [SOLVED] Recalculating Prize List when ties occur
    By elevdown in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-31-2008, 03:52 PM
  3. Help a dumb **** & win a prize
    By pricey in forum Excel General
    Replies: 1
    Last Post: 04-27-2006, 05:45 AM
  4. [SOLVED] Prize Calculation
    By shahbaze in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-15-2005, 06:45 PM
  5. [SOLVED] Prize Calculation
    By prize calculation in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-15-2005, 06: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