Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default random number generation: loop

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

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default random number generation: loop

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 *

"NickC " wrote in message
...
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 that
meets some conditions I have.

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

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

Any help would be vastly appreciated !


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default random number generation: loop

It works perfectly !

Thanks, Auk Ales.


---
Message posted from http://www.ExcelForum.com/

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
RANDOM NUMBER GENERATION. HARSHAWARDHAN. S .SHASTRI[_2_] Excel Worksheet Functions 4 September 21st 08 06:01 PM
Help for Random Number Generation krisinvincible Excel Worksheet Functions 3 May 7th 07 12:41 AM
random number generation scotjo Excel Worksheet Functions 4 January 9th 06 04:06 PM
random number generation DSpec Excel Worksheet Functions 7 October 3rd 05 01:41 PM
I need help with random number generation David Stoddard Excel Worksheet Functions 10 March 28th 05 07:06 AM


All times are GMT +1. The time now is 08:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"