Thread: Random Numbers
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
joeu2004 joeu2004 is offline
external usenet poster
 
Posts: 2,059
Default Random Numbers

On Jan 26, 2:47 pm, Soccer boy
wrote:
Without Copy and Special Pasteing the Value of the
generated random number, is there another way i can
keep the Rand() function from generating new numbers
everytime and only when i tell it too.


Not directly. But if you are amenable to using a VBA function, you
can bury the random number generation by using the VBA Rnd()
function. For example:

function myrand(optional rng as range) as double
myrand = rnd()
end function

With the optional range parameter, you can call it with simply MyRand
() or MyRand(A1). With the latter form, MyRand will be called
whenever A1 is modified (and whenever the worksheet is recalculated as
a whole).


----- original posting -----

On Jan 26, 2:47*pm, Soccer boy
wrote:
i am trying to run a precipitation model and am using the Rand() function to
help generate numbers inbetween certain values. *I am also using solver in my
spreadsheets, *The solver is having a hard time calculating everything
because the random numbers are being regenerated every time. *Without Copy
and Special Pasteing the Value of the generated random number, is there
another way i can keep the Rand() function from generating new numbers
everytime and only when i tell it too.