' Name: iShuffle + lShuffle (By: ANmarAmdeen on 5/13/2018 11:50:00 AM) ' Language: VBA | Category: Math ' Tags: RND ' Parameters: lMinValue, lMaxValue ' ' Link: http://MyDev.net/?DevID=F36JUYB3F ' ' Description: 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

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


ANmarAmdeen
45
Tags
RND
Parameters
lMinValue, lMaxValue
Math VBA