Random number

''' ---
''' Random Number
''' ---

Function RandomNumber(nMin, nMax)

RandomNumber = vbNull

If Not IsNumeric(nMin) Then Exit Function

If Not IsNumeric(nMax) Then Exit Function

If nMin >= nMax Then Exit Function

Randomize

RandomNumber = Int((nMax - nMin + 1) * Rnd + nMin)

End Function

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License