+ Reply to Thread
Results 1 to 6 of 6

Pasting array with formula2 values gives me out of memory error

  1. #1
    Registered User
    Join Date
    11-04-2004
    Location
    Athens
    MS-Off Ver
    2019
    Posts
    48

    Pasting array with formula2 values gives me out of memory error

    so i got this excel table i copy into a 2d array, i make some row modifications/additions and then paste it back to the same excel table.

    The table has some formulas refering to the table row by name like the following:

    Please Login or Register  to view this content.
    as you can see in the attached, the moment i paste the array im getting out of memory error.

    i dont get the error if my formula does not have named row refference like the following:

    Please Login or Register  to view this content.
    i tried all the following but no luck
    Please Login or Register  to view this content.
    idealy id like to keep the row named reference for obvious reasons. any ideas?
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    11-04-2004
    Location
    Athens
    MS-Off Ver
    2019
    Posts
    48

    Re: Pasting array with formula2 values gives me out of memory error

    I managed to resolve the issue.
    It seems that the problem was happening because i deleted the table data rows before pasting the array back. A table column reference was trying to be placed outside the table and excel complained with out of memmory. This is why when using the cell reference there was no problem.
    So this time after deleting the table data rows, i resized the table to the array size and no problem any more... almost!
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    However, even the array was correct, after beeing placed back to the table, excel was corrupting the referenced table columns of the same table inside the formulas for some reason!
    so for example
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    referencing a column in the same table
    after paste was transformed into
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    while
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    referencing a different table column
    remained correct.

    any ideas how to force/trick excel to not corrupt the formula referencing columns of the same table?

    thx!

  3. #3
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,386

    Re: Pasting array with formula2 values gives me out of memory error

    Maybe?

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-04-2004
    Location
    Athens
    MS-Off Ver
    2019
    Posts
    48

    Re: Pasting array with formula2 values gives me out of memory error

    hey, unfortunatly this results into
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    !

  5. #5
    Registered User
    Join Date
    11-04-2004
    Location
    Athens
    MS-Off Ver
    2019
    Posts
    48

    Re: Pasting array with formula2 values gives me out of memory error

    hm i think i will proceed as follows
    i will make the formula
    Please Login or Register  to view this content.
    which in turn results into
    Please Login or Register  to view this content.
    and after pasting the array i will replace "@Table_amounts" with "Table_amounts". It will always be the table name which needs to be corrected so its somewhat safe i guess

    thx JEC. for givinng me the idea!

  6. #6
    Registered User
    Join Date
    11-04-2004
    Location
    Athens
    MS-Off Ver
    2019
    Posts
    48

    Re: Pasting array with formula2 values gives me out of memory error

    Actually after getting some advice from chatgtp and after some wrong proposals and fine tuning i got the ideal solution!
    The moment of pasting the array back to excel should be
    Please Login or Register  to view this content.
    instead of
    Please Login or Register  to view this content.
    Apparently when using FormulaArray excel preserves the structured references and array formula syntax in contrast to .formula

    so no need for replacing and no need for
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    is enough!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Thrashing VBA Memory Leaks. Memory Loop Problems. Uncleared Memory in .Match Range Object
    By Doc.AElstein in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-10-2017, 05:17 PM
  2. Pasting formulaR1C1 from array to cells gives formulae, not values
    By adh2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-02-2016, 05:26 AM
  3. [SOLVED] Macro gets "Run time error '7' out of memory" for ReDim Array
    By capson in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-10-2014, 12:52 PM
  4. Copying & Pasting Values from Pivot Tables As Array
    By Mr Denove in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-19-2013, 04:31 AM
  5. Replies: 1
    Last Post: 12-08-2011, 08:52 AM
  6. Excel Memory when Pasting Values Only
    By sinkerhawk in forum Excel General
    Replies: 1
    Last Post: 08-08-2007, 04:49 PM
  7. [SOLVED] need list of unique values from array in memory
    By KR in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2005, 07:05 PM

Tags for this Thread

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