Thread: Random Numbers
View Single Post
  #10  
Old May 16th, 2009, 08:33 AM posted to microsoft.public.excel.misc
Jarek Kujawa[_2_]
external usenet poster
 
Posts: 775
Default Random Numbers

for C3:L3

Sub cus2()
Dim cell As Range


With Range("C3:L3")
..Clear
For Each cell In .Cells
repeat:
k = WorksheetFunction.RandBetween(0, 9)
If WorksheetFunction.CountIf(.Cells, k) = 0 Then
cell = k
Else
GoTo repeat
End If
Next
End With
End Sub


then assign cus to Button1 and cus2 to Button2

is this ok?


On 16 Maj, 08:55, robert morris
wrote:
Jarek,

Yes, random numbers between 0-9, Col Range B4:B13 and
random numbers between 0-9, Row Range C3:L3.

As I said, could be two codes with Buttons.

Bob



"Jarek Kujawa" wrote:
i.e. for row 3 from 0 to 9 and for col B from 0 to 9?


On 16 Maj, 07:39, robert morris
wrote:
Jim,


I need random numbers for BOTH Row 3 and Col B.


Have I answered your question correctly?


Bob


"Jim Cone" wrote:
Bob,
I think your requirements are a little too strict. g
You only allow ten unique numbers (0 to 9) and ten cells in each range.
Are you just trying to random sort all ten numbers?
--
Jim Cone
Portland, Oregon Â*USA


"robert morris"

wrote in message


I need help with a VBA for creating NON-REPEATING random numbers between 0-9
in Col B4:B13 and Row C3:L3


Bob- Ukryj cytowany tekst -


- Pokaż cytowany tekst -- Ukryj cytowany tekst -


- Pokaż cytowany tekst -