The function you are looking for is the RND function. Here is an
example of a wrapper around it:
Function RandomNumber(lngMaxNumber As Long, lngStartingNumber As Long)
As Long
'lngMaxNumber is how many numbers to choose from
'lngStartingNumber is the first number available
'I.E, to get a 3 digit number, use RandomNumber(900,99)
Randomize
RandomNumber = Int(Rnd(Timer) * lngMaxNumber) + lngStartingNumber
End Function
Chris Nebinger
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.