Results 1 to 48 of 48

Big List Sort. Not Enough Memory. Help Run my Code. Or help fix or change code Please :)

Threaded View

Doc.AElstein Big List Sort. Not Enough... 09-15-2016, 01:18 PM
Winon Re: Big List Sort. Not Enough... 09-15-2016, 01:39 PM
Doc.AElstein Re: Big List Sort. Not Enough... 09-15-2016, 02:26 PM
Winon Re: Big List Sort. Not Enough... 09-15-2016, 02:51 PM
Doc.AElstein Re: Big List Sort. Not Enough... 09-15-2016, 03:02 PM
Winon Re: Big List Sort. Not Enough... 09-15-2016, 03:33 PM
Doc.AElstein Re: Big List Sort. Not Enough... 09-15-2016, 03:52 PM
Winon Re: Big List Sort. Not Enough... 09-15-2016, 04:27 PM
Doc.AElstein Re: Big List Sort. Not Enough... 09-15-2016, 07:05 PM
NoSparks Re: Big List Sort. Not Enough... 09-15-2016, 09:12 PM
Doc.AElstein Re: Big List Sort. Not Enough... 09-16-2016, 04:32 AM
humdingaling Re: Big List Sort. Not Enough... 09-15-2016, 10:34 PM
humdingaling Re: Big List Sort. Not Enough... 09-15-2016, 10:47 PM
xlnitwit Re: Big List Sort. Not Enough... 09-16-2016, 04:01 AM
humdingaling Re: Big List Sort. Not Enough... 09-16-2016, 07:54 AM
Winon Re: Big List Sort. Not Enough... 09-16-2016, 07:25 AM
Doc.AElstein Memories... of Runing out of... 09-16-2016, 08:05 PM
Doc.AElstein Day 2: Waiting for my last... 09-19-2016, 07:57 PM
Doc.AElstein I would toggle your code, if... 09-20-2016, 02:29 PM
Doc.AElstein Thrashing VBA Memory Leaks.... 10-05-2016, 08:59 AM
Doc.AElstein Thrashing VBA Memory Leaks.... 10-05-2016, 09:00 AM
xlnitwit Re: Big List Sort. Not Enough... 09-16-2016, 08:03 AM
Doc.AElstein Cache Browser Data ... 09-16-2016, 10:18 AM
humdingaling Re: Big List Sort. Not Enough... 09-16-2016, 11:04 AM
Doc.AElstein Looks like Excel is the... 09-16-2016, 11:33 AM
xlnitwit Re: Big List Sort. Not Enough... 09-16-2016, 11:56 AM
Doc.AElstein Got Big list from xlNitWit... 09-16-2016, 12:14 PM
xlnitwit Re: Big List Sort. Not Enough... 09-16-2016, 12:49 PM
Doc.AElstein Re: Big List Sort. Not Enough... 09-16-2016, 01:11 PM
Winon Re: Big List Sort. Not Enough... 09-16-2016, 08:53 PM
Doc.AElstein Delete, Close Doesn't "Clear"... 09-17-2016, 05:48 AM
Winon Re: Big List Sort. Not Enough... 09-17-2016, 11:04 AM
Doc.AElstein Re: Big List Sort. Not Enough... 09-17-2016, 11:36 AM
Doc.AElstein Re: Check Difference between... 09-18-2016, 08:26 AM
Doc.AElstein So two closed workbook code... 09-18-2016, 08:42 AM
xlnitwit Re: Big List Sort. Not Enough... 09-19-2016, 08:52 AM
Doc.AElstein Re: Big List Sort. Not Enough... 09-19-2016, 09:22 AM
xlnitwit Re: Big List Sort. Not Enough... 09-20-2016, 01:49 AM
Doc.AElstein Re: Big List Sort. Not Enough... 09-20-2016, 04:58 AM
xlnitwit Re: Big List Sort. Not Enough... 09-20-2016, 06:32 AM
Doc.AElstein Bugger... Another Theory of... 09-20-2016, 07:36 PM
Doc.AElstein Getting there :) ..... slowly... 09-22-2016, 09:53 AM
xlnitwit Re: Getting there :) ........ 09-22-2016, 11:28 AM
Doc.AElstein Re: Getting there :) -- Next... 09-23-2016, 05:00 PM
Doc.AElstein Bugger me, a major... 09-25-2016, 08:21 PM
Doc.AElstein VBA is a weird Bugger when it... 09-26-2016, 06:12 PM
Doc.AElstein Trash the Big Excel File (... 09-27-2016, 08:23 PM
Doc.AElstein Re: Big List Sort. Not Enough... 06-08-2017, 06:56 AM
  1. #33
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Bugger... Another Theory of mine bites the dust

    Hello

    I just read some of what I said in the last Post, .... some of it could be bollox.
    .. or so I thought
    The bit about Excel having a non clearable record after every long line paste may have been OK,

    But i am not ( yet ! ) convinced that the Range Object as second argument in a .Match is necessarily a bad idea. But I could be wrong, - I am not interested in so much in what I end up doing but the Why and What is happening is important to me.

    So to that end,- current experiment
    Background.
    I always used to build up a big final Output Array within, as it were, VBA to then paste out in one go. In answering many Sorting Threads I still do. I had gone a bit off it with my own work as I have worksheets I use daily for me and my Wife’s Diets that are from about 2 – 4 times as big as the final Output Array here. I have experienced Problems , that is to say it just don’t work capturing and pasting out Arrays of those size. ( In addition when I modify or add in one bit of stuff we eat, it is better to just update a row and then add the increased Nutritional values to to the current total etc.. etc..
    In any case I got a bit side tracked from the idea of filling a large Array for output as an alternative for this particular problem.

    So what to do for this post
    As a first step I will simply modify my_..
    Sub USDAToDBArraysThirdWB()
    _...just so as to fill a big Array for output. See what happens then take it from there...

    So the key to it working, I am ( was ) thinking is this bit from xlnitwit code: ( and the subsequent one off pasting of it at the end )

    Dim arrDblxRowHolder() As Variant
    ReDim arrDblxRowHolder(1 To UBound(UniqueFoodNamesList) + 1, 1 To lcDBlx - 10)

    I think I might like to keep this a Variant, as I did my Long Row Output Row Array, arrDBlxRow() as I prefer to leave Empty Cells as Empty, rather than them converting to vbNullString for strings, ( worse, - 0 , for Numbers – as that can really screw up average calculations when = are included rather than, as required, blanks being ignored )

    My Row Output Row Array,arrDBlxRow() Dim and Re Dim is now commented out. Note I will not now replace it at that point with Dim and ReDim arrDblxRowHolder(). The reason for this being that arrDBlxRow() was deliberately REDim ed without Preserve at the start of the =Main Outer Food Produkts Loop=
    ‘4a

    so as to empty it for the next rDBlx ( the for Output Worksheet , in DBSept2016.__ File ) . rDBlx had defined the “K” & rDBlx output Top Left for each Long Row Output Row Array, arrDBlxRow(). Correspondingly it started at 20, being incremented just before the_...
    “K” & rDBlx = arrDBlxRow()
    _..bit.

    Now in the new code and as in xlnitwit's rDBlx is free to use for our “row” in the big Output Array, arrDblxRowHolder() . A good point somewhere back up in the code to Dim ( and Re Dim only once now ) for arrDblxRowHolder() would be , for example , in the
    490 Rem 2) Dogs Bollox Workbook
    _.. like what xlnitwit did. There we have lcDBlx, the Last column in the for Output Worksheet , in DBSept2016.__ File and just before this at
    ‘1f ) we have the unique Diktionary Keys ( Unique Produkt names effectively ) and can get the total then for output data row number from something of the form, pseudo,
    UBound(arrKeys() = Dik.Keys())-LBound(arrKeys() = Dik.Keys()) +1
    So
    522 Dim arrDblxRowHolder() As Variant
    524 ReDim arrDblxRowHolder(1 To UBound(arrKeys()) + 1, 1 To lcDBlx - 10)

    So for this simply first Big Output Array example we need to comment out the Long Row Output Row Array Paste line which just inside at the end of the
    1090 ===Main Outer Food Produkts Loop
    and just outside this have a new line only to be done once right at the end
    1095 Let wsDBlx.Range("K21").Resize(UBound(arrDblxRowHolder), lcDBlx - 10).Value2 = arrDblxRowHolder()
    which is exactly what xlnitwit did.

    All that remains now is to modify the central bit of the code to add things to this Array rather than the Long Row Output Row Array, arrDBlxRow(). So the Value of Found Nutrition is put in Array for output at the position of the matched Nutritional Heading Name as before, but also now at the appropriate rDBlx ( rDBlx used now as starting at 1, - our intention being to paste the final Array out from Top left at K21 , as seen above line 1095.

    So I did all that.... ran the code...
    Sub USDAToDBArraysThirdWBarrOutLongRangeRow()

    Poo ! It bombed out again at 348 rows.. I did not expect that !!!

    Have to think again !!

    Bollox ( well at least some of what I said in the last post was not as much Bollox as I thought at the start of this post ?!? )..... Bo....

    I am determined to get to the bo..ttom of this....

    Later..
    Alan



    _._________________________________________-

    _...............................................
    ( Code Sub USDAToDBArraysThirdWBarrOutLongRangeRow()
    http://www.excelforum.com/showthread...=1#post4485268
    and here
    http://www.excelforum.com/showthread...66#post4485266


    And in this file
    MacrosOnly.xlsm
    https://app.box.com/s/dvxkvwvebq4npqzrlxy9um86uwg4mr82

    Sub USDAToDBArraysThirdWBarrOutLongRangeRow() '
    Sub USDAToDBArraysxlnitwit()
    And the original ( bombing out in 32 Bit )
    Sub USDAToDBArraysThirdWB()
    Sub USDAToDBSpreadsheetThirdBook()
    Attached Files Attached Files
    Last edited by Doc.AElstein; 09-20-2016 at 07:50 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Code For A Custom Sort Using A List On Another Sheet
    By rockyw in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-06-2016, 08:51 PM
  2. [SOLVED] VB Code to sort the list
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-18-2016, 08:34 PM
  3. Help rewriting code to use less memory
    By Karl Gustaf Karsten in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-23-2016, 12:56 PM
  4. just a smidgeon of correction to VBA sort list code please
    By yogup in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-05-2016, 01:48 PM
  5. VB Code to sort the list in ascending order
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-22-2015, 12:08 PM
  6. Add Custom Sort List to VBA code
    By Zyphon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-12-2009, 09:44 AM
  7. [SOLVED] How much memory does VBA code occupy?
    By Ozgur Pars in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-12-2006, 02:09 PM

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