random number generation: loop

  • Thread starter Thread starter NickC
  • Start date Start date
N

NickC

Hello,

I am trying to do a simulation.
I have many random numbers (rand()) within my spreadsheet.

Right now, I keep hitting F9 until I get a certain set of numbers tha
meets some conditions I have.

I would like to know how to program a loop that essentially recalcs th
spreadsheet (just like hitting F9 over and over again) until a certai
cell value is less than a certain numerical value.

Additionally, I want many sets of random numbers that fit this criteri
(otherwise, I could hit F9 until I get one set and then just quit). S
I need something I can "run" repeatedly.

Any help would be vastly appreciated
 
Nick,

Suppose the randomly filled cell = A1 , this routine will run until the
value of this cell < the value you specify ( fill in for ???)

Mind however that this routine might end up in an endless loop if you don't
choose your conditionvalue carefull !!!

Sub RunTillCondition()
ConditionValue = ???
While Cells(1, 1) >= ConditionValue
Calculate
Wend
End Sub

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *
 
Back
Top