Among other things, that article says, "In Microsoft Excel
for Windows, adding randomize=1 to the [Microsoft Excel]
section of the appropriate .INI file for your version of
Microsoft Excel will cause "r" to be determined from the
system clock (which adds a further degree of randomness to
the numbers generated)." Because I am supposed to analyze
the random number generator and write a report about my
findings, I would like to be able to control the seed
value, so my results will be repeatable.
I am running Excel 2002 on Windows 2000 Pro. I can't seem
to find "the appropriate .ini file" on my system. My
system adminstrator says that .ini files don't really exist
any more.
Q: Is there a way in Excel 2002 for a user to control or
initialize the seed value that the RAND() worksheet
function uses?
Some of my research leads me to believe that if I used the
Rnd function in VBA for Excel (where I believe I can
control the seed value -- KB article 129742), that I would
actually be using a different algorithm.
Q: Does anyone know if the Rnd and Randomize functions in
VBA for Excel use the same algorithm as the RAND()
worksheet function?
I would appreciate any help.
Sincerely,
David E. Gray
Note that the cited KB article goes back a ways - it claims to apply to the
original 1.0 Mac version. Anyway, .INI files were used in 16-bit versions of
Windows and 16-bit Windows apps. The Windows Registry is used for similar
information in 32-bit Windows/apps. You may need to add a Randomize value to the
registry key
HKEY_CURRENT_USER\Software\Microsoft\Office\8.0\Excel\Microsoft Excel
set to 0 to see if you can always start with the same seed.
>Some of my research leads me to believe that if I used the
>Rnd function in VBA for Excel (where I believe I can
>control the seed value -- KB article 129742), that I would
>actually be using a different algorithm.
>
>Q: Does anyone know if the Rnd and Randomize functions in
>VBA for Excel use the same algorithm as the RAND()
>worksheet function?
No. VBA's Rnd/Randomize are separate and distinct from Excel's RAND().
--
Public Service Announcements:
1. Don't attach files to postings in this newsgroup.
2. Learn how to snip unnecessary text from quoted material. Indiscriminate
quoting wastes more bandwidth than file attachments.