Tabulating random number results
VBA Telemetry pings you when your VBA projects fail
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 6 of 6

Thread: Tabulating random number results

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I have an excel spreadsheet that analyzes Powerball numbers. One of the worksheets in the file is used to generate random numbers. It is set up with a macro button to generate 5 random numbers in 5 specific cells and regenerates a new set of numbers in the same cells with each "push" of the button. What I would like to do is tabulate the results of each "push" of the button in a table (preferably in the same worksheet). I have not been able to figure out how to accomplish this....any suggestions.

  2. #2
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    What do you actually want to save? (the number of times a number appears, or the number of times two numbers appear together, or what?)

  3. #3
    MrExcel MVP Jay Petrulis's Avatar
    Join Date
    Mar 2002
    Location
    Chicago, IL USA
    Posts
    2,040
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi,

    You couldn't have known, but unique random numbers have been quite a topic around here in recent days.

    Assuming that A1:E1 are the cells housing your lottery numbers and that columns F:J are where you are storing the trial runs, add this to your subroutine before you do anything else.

    -------------
    Sub tester()
    Dim nextrow As Long
    nextrow = Cells(Rows.Count, "F").End(xlUp).Row + 1
    Range("F" & nextrow & ":J" & nextrow) = Range("A1:E1").Value
    End Sub
    -------------

    HTH,
    Jay

  4. #4
    New Member
    Join Date
    Apr 2002
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-16 13:02, Al Chara wrote:
    What do you actually want to save? (the number of times a number appears, or the number of times two numbers appear together, or what?)
    I merely want to tabulate each set of numbers in a 5-column table.

  5. #5
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Jays macro will work nicely.

  6. #6
    New Member
    Join Date
    Apr 2002
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    On 2002-04-16 13:14, Jay Petrulis wrote:
    Hi,

    You couldn't have known, but unique random numbers have been quite a topic around here in recent days.

    Assuming that A1:E1 are the cells housing your lottery numbers and that columns F:J are where you are storing the trial runs, add this to your subroutine before you do anything else.

    -------------
    Sub tester()
    Dim nextrow As Long
    nextrow = Cells(Rows.Count, "F").End(xlUp).Row + 1
    Range("F" & nextrow & ":J" & nextrow) = Range("A1:E1").Value
    End Sub
    -------------

    HTH,
    Jay
    Thanks, I will try this and see what happens!!

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com