LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel VBA - macro to recalculate random numbers until target reached

Hi

I'm trying to perform the following procedure and hopefully someone ca
help:

In cells A1..F1 in Excel I have a function =randbetween(1,20)
In cells G1..L1 I have the numbers 2,4,6,8,10,12

In cells A2..F2 I also have the function randbetween(1,20) and in cell
G2 to L2 I have the numbers 3,6,9,12,15,18

Each time one presses F9, the random numbers in A1..F2 wil
recalculate.

What I would like to perform if possible is the following routine i
the order that follows:

(1) Recalculate the spreadsheet until the condition is met tha
a1=g1,b1=h1,c1=i1,d1=j1,e1=k1 and f1=l1.
(2) Once that condition is met record in cell m1 how many times th
recalculation had to be performed until that condition was met.
(3) Also, once that condition is met paste g1..l1 over a1..f1 so tha
no further random number generations will occur in a1..f1.
(4) Move the routine on to the next row (i.e. row 2) and perform th
same procedure as in A1..F1 above.

Many thanks,
Gre

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

 
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
Excel fromula: Adding numbers from list to achieve a target BillD Excel Discussion (Misc queries) 4 May 28th 10 07:55 AM
Excel fromula: Adding numbers from list to achieve a target ck13 Excel Discussion (Misc queries) 0 May 27th 10 09:12 PM
Non-random numbers generated by excel's data analysis random gener Allie Excel Worksheet Functions 10 September 17th 05 06:19 AM
Non-random numbers generated by excel's data analysis random gener Harlan Grove Excel Discussion (Misc queries) 2 September 13th 05 04:06 PM
Trying to F9 sum of random numbers until certain value is reached langba[_3_] Excel Programming 5 April 19th 04 09:30 PM


All times are GMT +1. The time now is 09:49 PM.

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

About Us

"It's about Microsoft Excel"