+ Reply to Thread
Results 1 to 10 of 10

Storing the output generated from random numbers in different cells

  1. #1
    Registered User
    Join Date
    07-17-2012
    Location
    San Antonio, Texas
    MS-Off Ver
    Excel 2007
    Posts
    4

    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. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    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.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    07-17-2012
    Location
    San Antonio, Texas
    MS-Off Ver
    Excel 2007
    Posts
    4

    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. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

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

    Maybe ...

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    07-17-2012
    Location
    San Antonio, Texas
    MS-Off Ver
    Excel 2007
    Posts
    4

    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. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    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. #7
    Registered User
    Join Date
    07-17-2012
    Location
    San Antonio, Texas
    MS-Off Ver
    Excel 2007
    Posts
    4

    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. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

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

    You're welcome, good luck.

  9. #9
    Registered User
    Join Date
    04-11-2013
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    1

    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. #10
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

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

    babsonresearch,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Bookmarks

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