我写的随机函数,缓解了随机函数不随机的问题
'随机函数生成
'输入值:生成值范围 i~j
'返回值:随机数
Public Function Get_RandNum(fromNum,toNum)
Dim RunTime
Randomize
RunTime = Int((10 * Rnd) + 1)
Dim MyValue,i
For i = 1 To RunTime
Randomize
MyValue = Int(((toNum) * Rnd) + (fromNum))
Next
Get_randNum=Myvalue
End Function