# Storing the output generated from random numbers in different cells

1. ## Storing the output generated from random numbers in different cells

Hi,

Let me explain the problem first:

I have a 14x20 matrix which has random (normally distributed) numbers. I get an output or a result from these numbers which necessarily changes each time any of the value of those 14X20 matrix changes. But I need to store these results for each of these random numbers in a different place. I need to do 1,000,000 trials. So what I need is in a nutshell to store the value of cell A1 to 1000X1000 matrix each time its value is changed.

Any help would be greatly appreciated.

Thanks.

2. ## Re: Storing the output generated from random numbers in different cells

I don't understand the reference to one cell A1 when you have 280 random numbers in your matrix which will change.
Are you saying that if any of those 280 numbers changes you want to store those numbers?

And what constitutes a change? Are you comparing each cell with the same cell position each time?

And what is triggering the change.

A worked example would be useful.

3. ## Re: Storing the output generated from random numbers in different cells

Sorry for the confusion Richard,

I need to store the A1 value 1,000,000 times when I change the random numbers. The value of A1 is changed when the random numbers change. I don't want to store the random numbers but only the different values of A1 each time the random numbers change. This can be explained like A1 = f(x) ; here x is the random numbers. But I need to store the A1's. Maybe 1,000,000 of them when I change x1, x2 x3.....x280 (280 numbers) 1,000,000 times. The question is how to link the new 1,000,000 cells to read from the changing cell A1 and store it?? Sorry if I made it difficult.

4. ## Re: Storing the output generated from random numbers in different cells

Maybe ...

``Please Login or Register  to view this content.``

5. ## Re: Storing the output generated from random numbers in different cells

Thats great shg! I did For iRow = 50 To 1050 For iCol = 3 To 1003 as I have from 1-50 and 1-3 occupied. It looks good but at a stage the program stops as the recordings go beyond the limit/capacity of the worksheet as per the column. I think I am pretty close..... the debug option highlights the line ///Sheet2.Cells(iRow, iCol) = Sheet2.Range("F32")////.....

6. ## Re: Storing the output generated from random numbers in different cells

You're working in compatibility mode. Save the workbook as an xlsm file, close and reopen.

7. ## Re: Storing the output generated from random numbers in different cells

I got it right shg! actually the problem was the limitation of columns. but it seems the rows are unlimited or have a very high capacity. I got all my numbers! Hatts off to you!

8. ## Re: Storing the output generated from random numbers in different cells

You're welcome, good luck.

9. ## Re: Storing the output generated from random numbers in different cells

Hi,

I'm looking to get help with a similar problem. I have an output cell based on a random number generator which I wish to store 100 times in order. I tried to using the above macro but all is happening is a 100 iterations without storing any of the output values.

To clarify - I have a value from one output cell that will need to be stored, in a different cell, each time a new value is calculated. The numbers need to be stored in order.

Please let me know if anyone can help!

10. ## Re: Storing the output generated from random numbers in different cells

babsonresearch,

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1