Thread: random number
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Nigel Nigel is offline
external usenet poster
 
Posts: 923
Default random number

This yields a positive integer of 1 or 2; as random as XL is using the built
in random function

score = Int((2) * Rnd + 1)


--
Cheers
Nigel



"Jean-Paul De Winter" wrote in message
...
Hi
I need a random number... or it is 1 or it is 2
Now I use this "formula"
score = Int(Right(Val(Second(Now()) * 3.14), 1))
If score = 6 Then score = 2 Else score = 1
it is placed in a loop but doesn't really returns 1 and 2 randomly

Any idea?
Thanks