Hi,
I've written a mathematical model using excel for a probability problem which requires the generation of random numbers. The idea is that I can run the model to see how long it takes for a certain condition is be satisfied.
At the moment I have to press F9 for the RAND() function to create a new set of numbers and then manually check to see if a particular cell is greater than or equal to 5. If it is not, I then repeat the process until the conditional is met.
It is also important for me to know how many times the random numbers were generated before my condition was met. I am currently counting the number of times I press F9 before the condition is met.
I have tried to figure out how to automate this process using a Macro but have failed miserably. I have no experience with Visual Basic and would appreciate any help available.
In summary, I want the following to take place in a macro:
1. Recalculate spreadsheet (i.e. generate random numbers)
2. Check if T24 is larger than or equal to 5
3. If No, loop back to Step 1
4. If Yes, stop macro and display number of iterations required
Many Thanks
Bookmarks