![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 7
|
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 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
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 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
|
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 | |
|
New Member
Join Date: Apr 2002
Posts: 7
|
Quote:
|
|
|
|
|
|
|
#5 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
Jays macro will work nicely.
|
|
|
|
|
|
#6 | |
|
New Member
Join Date: Apr 2002
Posts: 7
|
Quote:
|
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|