+ Reply to Thread
Results 1 to 4 of 4

VBA Exceeding Calculation Resources

  1. #1
    Valued Forum Contributor Miraun's Avatar
    Join Date
    04-03-2009
    Location
    New England
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    554

    VBA Exceeding Calculation Resources

    Thanks for the help on the filling to columns... I know it may not be best practice, but I was autofilling some multi-tiered array formula to be used for some graphing down the line...

    However, now that I can successfully populate a nice 40-50 array formula instantaneously within the VBA, I've obtained a new error code that I have never seen before!

    "Excel Ran out of resources while attempting to calculate one or more formulas. As a result, these formulas cannot be evaluated"

    Is there a VBA command I can use to purge the memory after particular pieces of a long macro have executed?
    Or perhaps someone have a website that they can refer me to that explains how to better use Subs and modules to assist in excel memory allocation?


    The file itself is only 55kb, but it is currently taking up 835,200k in my task manager. Any ideas?

    I'd like to think my code isn't THAT poorly written
    Last edited by Miraun; 06-27-2011 at 04:29 PM.
    Going for Guru! Click the Star to the bottom left of this post if I helped!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,188

    Re: VBA Exceeding Calculation Resources

    I'd like to think my code isn't THAT poorly written
    Hard to comment without seeing the code or the workbook.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Valued Forum Contributor Miraun's Avatar
    Join Date
    04-03-2009
    Location
    New England
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    554

    Re: VBA Exceeding Calculation Resources

    Yeah, you're right on that TM...

    I've done some research on it myself, and noticed a few things that I could have done better...

    First and foremost, I took the lazy way of performing lookups and references and used entire columns rather than just the usedrange of the columns. An additional step that could have saved tons of calculation time... I was under the impression that in 2007, if you used a column reference, it would only perform that calculation on the usedrange within that reference... apparently not!

    I didn't properly divide my macros by modules... so it was running error-proofing on all subs, regardless of which one was being run.

    I also didn't turn Application.Calculation to Manual from automatic.

    I'll go ahead and mark it closed, make those changes, and then if I have more problems, I'll post some sections of the code. The problem is that the data is pretty confidential, and it's difficult to understand the code without the data.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,188

    Re: VBA Exceeding Calculation Resources

    As you wish.

    It is still possible to offer some advice on the code, although it can be difficult to test and check that the original expectation is still met.

    Regards

+ 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