My problem is that I am trying to do a series of random numbers let say between 1-10 and these numbers are going to be spread out on like 50 posts and the same random number can only occur max 6 times.
(Edited)
My current code is written that I count the rows with a value divided with 6 to determine how many different random numbers I need. If 58 cells have value i need random numbers between 1-10. I think the max Rows i need will be 200
Dim i As Integer
Dim a As Integer
a1 = ActiveSheet.UsedRange.Rows.Count
Range("E1") = a1
For i = 1 To a1
MinNumber = 1
MaxNumber = a1 / 6
Range("D1") = MaxNumber
Cells(i, 1).Value = Int((Rnd * (MaxNumber - MinNumber + 1)) + MinNumber)
Next i