+ Reply to Thread
Results 1 to 3 of 3

Print to worksheet and Jagged Array

  1. #1
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Print to worksheet and Jagged Array

    I am working with a large file, calculating and printing the results to an array. Once all the calculations are done I print the results to the worksheet. Now the end result may take up more than the 56K limit for using transpose so now I am stuck with only a few options:

    1) Redim the 2nd dimension (e.g. 1 to 5, 1 to 100000) and then use a loop to exchange all the first dimension elements with the second dimension elements thereby transposing the array

    2) Starting off with a huge array from the start (e.g. 1 to 100000, 1 to 5) which is inefficient

    I have thought that it might be possible to create a jagged array with each element consisting of two-dimensional arrays (1 to 5, 1 to 56000) and then internally transpose to print to sheet.

    This is all theoretical and it might not be possible to redim a jagged array or transpose an element with a jagged array.

    If anyone has knowledge or experience with this or another workaround, please let me know.

    Thanks.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Print to worksheet and Jagged Array

    I would dimention the array like
    Please Login or Register  to view this content.
    So that you don't need to transpose.

    If the result reaches to the limit, print the result to the sheet and ReDim (empty the array) and do the same thing again.

    My small PC is capable to do this.
    e.g
    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Print to worksheet and Jagged Array

    Hi jindon,

    Thank you for the example. I have always assumed that the amount of memory needed to contain 5 million element like you demonstrated would be huge, but seems that I was mistaken. Thank you for showing me this approach. I will test it on my next analysis run. In the past, I have just limited the outcome by putting limitations on the number of results I would accept from the run, but now I just by seeing your example in action, I will try to push my computer's limits.

    abousetta

+ 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