Interesting topic...
The page color=#0000cchttp://dada.perl.it/shootout/random_allsrc.html shows actually a basic Pseudorandom Number Generator in many different scripting languages. According to the "shootout" they all come up with exaclty the same number results.
For the "standard" user the random numbers implemented in javascript, VB, Excel etc. should usually not require to program your own Random Generating Routine. If the programming language that you are using does not have a random function (other than ancient COBOL I would not know any) you might need it but hmmm....
To answer the original question....
In Microsoft Excel, the RAND function uses the following iterative method to calculate pseudo-random numbers:
The first random number:
random_number=fractional part of (9821 * r + 0.211327),
where r = .5
Successive random numbers:
random_number=fractional part of (9821 * r + 0.211327),
where r = the previous random number
According to Microsoft this formula will provide up to 1 million different numbers.
Good Luck,
ME