+ Reply to Thread
Results 1 to 4 of 4

Procedure Too Large Issue

  1. #1
    Registered User
    Join Date
    10-05-2017
    Location
    Milwaukee
    MS-Off Ver
    2016
    Posts
    15

    Procedure Too Large Issue

    I have Worksheet Calculate event embedded in a worksheet that fires each time separate arrays change that I am monitoring. I log different statistics based upon if these arrays change or not. There are a lot of lines of code related to the arrays I monitor. Hence the issue of closing in on the >64Kb compile procedure limit. I am looking for advice on how to consolidate some of this code into a separate module or class module that is called on its own to reduce the number of characters to get under 64Kb and achieve the overall task of the Worksheet Calculate event. Below is a portion of the code. I am looking to consolidate the L thru W "strformula" references to Sheet1 & Sheet5 to clean it up and get it under the 64Kb limit.

    Please Login or Register  to view this content.
    This code continues on for ~1,000 lines from MyArr to MyArr46 & from KeyCells to KeyCells46
    Last edited by mjac101; 06-25-2023 at 12:09 AM.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Procedure Too Large Issue

    Hi, just to be practical, I have similar files with formulas with multiple IFS and more.
    What I would suggest is to build al the formulas using a normal Module.
    Like you did is good, dispable all calculations, events and screen updates first.
    Complete all the formula building that, without the file to is something nobody can check for you.
    After all the basics are set then reset all the evnets and just run the code
    Please Login or Register  to view this content.
    Again without a sample file it's impossible to really tell you what to change and see how it's actually built
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Valued Forum Contributor
    Join Date
    11-27-2011
    Location
    usa
    MS-Off Ver
    Excel 2007, Excel 365
    Posts
    495

    Re: Procedure Too Large Issue

    @mjac101, see if the following shortened version works for you:

    Please Login or Register  to view this content.

    Edit: I'm not sure what 'PopulateBA', ' PopulateBA2', etc is. If those are procedures that you are calling then that section could be shortened to:
    Please Login or Register  to view this content.

    That would leave the number of lines of code = 84 ... about 1/3 less than your original code.
    Last edited by johnnyL; 06-24-2023 at 09:04 PM.

  4. #4
    Registered User
    Join Date
    10-05-2017
    Location
    Milwaukee
    MS-Off Ver
    2016
    Posts
    15

    Re: Procedure Too Large Issue

    Interesting I see what you did here and it makes sense. Let me rewrite and test. I was just about to make a test workbook to post for easier feedback but this might be just what I need.

+ 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] VBA-Procedure Too Large!
    By barrymac20 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 12-10-2018, 08:06 AM
  2. VBA - Procedure too large.
    By northlondonpirate in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-21-2016, 04:46 AM
  3. [SOLVED] Procedure too large
    By shiftyspina in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-19-2016, 10:38 AM
  4. Procedure too Large
    By Spherous in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-07-2013, 06:42 AM
  5. [SOLVED] Procedure too large
    By battenborrow in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-02-2013, 08:51 AM
  6. Procedure too large
    By JonathonHardy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-27-2011, 01:34 PM
  7. Procedure Too Large
    By shsassy in forum Excel General
    Replies: 2
    Last Post: 12-14-2007, 01:20 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