T
tom taol
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!
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!