iShuffle + lShuffle

Generates a random number, integer or long

Function iShuffle(lMinValue As Long, lMaxValue As Long) As integer
Randomize ' Uses system timer to seed the Rnd function
iShuffle = int((lMaxValue +1 - lMinValue) * Rnd + lMinValue)
End Function

Function lShuffle(lMinValue As Long, lMaxValue As Long) As Long
Randomize 'Uses system timer to seed the Rnd function
lShuffle = (lMaxValue - lMinValue) * Rnd + lMinValue
End Function

lMinValue, lMaxValue

Views 324 Downloads 139

'RND'

ANmarAmdeen
323
Math VBA
Revisions

v1.0

Tags