View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jerry W. Lewis Jerry W. Lewis is offline
external usenet poster
 
Posts: 837
Default ATPVBAEN XLA [Number casual]

As Tom has noted, random integers returned by RANDBETWEEN are not
constrained to be unique. The usual approach to generate unique random
integers between say 1 and 50, would be to put all the integers 1..50 in
50 rows of a column; put =RAND() in the corresponding rows of the
adjacent column; sort both columns by the random column; then use
however many values you want, in order, from the first column.

Jerry

Aristotele64 wrote:

Hi from italy...so sorry for my bad english :)

I use this code :

Application.Run "ATPVBAEN.XLA!Histogram",
Sheets("Archivio").Range("$A$2:$H$5000") _
, ActiveSheet.Range("$D$46:$E$77"), ActiveSheet.Range("$A$1:$A$32"),
False _
, False, False, False

to generate a serial of casual number.

My question :

is possibile to *avoid* that a number is present 2 o 3 time in a row ?

example to avoid :

9 10 11 11 12 15 18 30
6 11 11 15 23 23 25 31