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


"Jerry W. Lewis" ha scritto nel messaggio
...
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.


many thanks i don't know this.........

but my problem is that i want generate casual number with a column of
number
and respective column of a probability and
ATPVBAEN XLA was perfect , only things bad is that a row have number not
unique


Example i have this :

Num Prob

1 0,035181345
2 0,037730718
3 0,045967154
4 0,0300826
5 0,03953489
6 0,038750467
7 0,025493729
8 0,032122098
9 0,025689834
10 0,030592474
11 0,027533227
12 0,02765089
13 0,030514032
14 0,03184755
15 0,028945187
16 0,025493729
17 0,031925992
18 0,0300826
19 0,032122098
20 0,032292056
21 0,0292668
22 0,032088106
23 0,030116591
24 0,034263571
25 0,028552976
26 0,028077093
27 0,024643938
28 0,026173561
29 0,029980625
30 0,032835922
31 0,032088106
32 0,032360039


this code :

Application.Run "ATPVBAEN.XLA!Random", ActiveSheet.Range("$P$2:$W$5000"), 8
_
, 5000, 7, , ActiveSheet.Range("$G$1:$H$32")


working but on 5000 rows i have 3000 with a repeat number.....

is there on web page where speaking : how to write ATPVBAEN.XLA!Random
function ?


TIA