G
Guest
I have the following function which works great for returning a random
number in a range from a specified low to a specified high:
Public Function RandomNumbers(argLow As Long, argHigh As Long) As Long
'RETURN A RANDOM NUMBER BETWEEN 'argLow' AND 'argHigh'
Randomize
RandomNumbers = CLng((argHigh - argLow) * Rnd + argLow)
End Function
Now I need a similar function that would return a random letter between A
and Z. Can anyone suggest a more efficient method than just assigning all the
letters of the alphabet to numbers between 1 and 26 to return a random letter?
Thanks in advance.
number in a range from a specified low to a specified high:
Public Function RandomNumbers(argLow As Long, argHigh As Long) As Long
'RETURN A RANDOM NUMBER BETWEEN 'argLow' AND 'argHigh'
Randomize
RandomNumbers = CLng((argHigh - argLow) * Rnd + argLow)
End Function
Now I need a similar function that would return a random letter between A
and Z. Can anyone suggest a more efficient method than just assigning all the
letters of the alphabet to numbers between 1 and 26 to return a random letter?
Thanks in advance.