View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
tom taol tom taol is offline
external usenet poster
 
Posts: 52
Default possible until 5461


sub ex()
n = 5462

ReDim aRnd(1 To n)
ReDim uniq(1 To n)

For i = 1 To n: aRnd(i) = i: Next

For i = n To 2 Step -1
k = Int(Rnd * i) + 1
n_cnt = n_cnt + 1
uniq(n_cnt) = aRnd(k)
aRnd(k) = aRnd(i)
Next

uniq(n) = aRnd(1)
Range("b1:b" & n).Value = Application.Transpose(uniq)
end sub

why error?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!