Thread: Random Numbers
View Single Post
  #5  
Old May 16th, 2009, 06:41 AM posted to microsoft.public.excel.misc
robert morris
external usenet poster
 
Posts: 245
Default Random Numbers

Jarek,

Thanks, your Code works perfectly for the Column B but does not address Row 3.

Bob

"Jarek Kujawa" wrote:

would this macro help?

Sub cus()
Dim cell As Range

With Range("B4:B13")
..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

On 16 Maj, 05:47, robert morris
wrote:
I need help with a VBA for creating NON-REPEATING random numbers between 0-9
in Col B4:B13 and Row C3:L3

Bob