17-07-2008, 08:04 PM
Dragoons Master Wrote:Code:Dim MyValue
MyValue = Int((6 * Rnd) + 1) ' Generate random value between 1 and 6.
That wouldn't work. if Rnd turned out to be .9, then MyValue would equal 7.
Here's a working function.
Function Rand(ByVal Low As Long, ByVal High As Long) As Long
Rand = Int((High - Low + 1) * Rnd) + Low
End Function