Thread: Random Numbers
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jarek Kujawa[_2_] Jarek Kujawa[_2_] is offline
external usenet poster
 
Posts: 896
Default Random Numbers

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