Public Function randomValue(top As Integer, low As Integer) Randomize ' Initialize random-number generator. randomValue = Int((top - low + 1) * Rnd) + low ' Generate random value between low and top. randomValue = Int(top * Rnd) + low End Function
Which calc is correct? They can't both be. can they ?
If a number wanted between 10 and 22 then it'd be int(13*rnd)+ 10. That's different to the 2nd calc.