+ Reply to Thread
Results 1 to 4 of 4

Macro Tied to Complex Nested If Statement Extremely Inefficient/Slow - HELP

  1. #1
    Registered User
    Join Date
    10-05-2011
    Location
    Des Moines, Iowa
    MS-Off Ver
    Excel 2003
    Posts
    3

    Exclamation Macro Tied to Complex Nested If Statement Extremely Inefficient/Slow - HELP

    I have put together a workbook that contains a mixture of macros and the use of complex nested if statements. The workbook is set up so that the macro adds a specific amount to one cell then that cell flows to another worksheet. In the other worksheet, the changing numbers created by the macro effects a large array of complex nested if statements. The source of the inefficiency is the nested if statements that play off each other in large array in which the cells must constantly interact due to the number change in the other worksheet.

    So, in short, a macro changes a value using a loop until statement that then cascades through a large array of nested if statements. Each time the value changes the nested if statements must refresh resulting in an unacceptably slow macro.

    PLEASE HELP.

    Thanks in advance!

  2. #2
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Macro Tied to Complex Nested If Statement Extremely Inefficient/Slow - HELP

    Welcome to the forum! Without seeing your workbook, I'd suggest turning on and off screen updating and calculation at strategic points. This may gain you a bit of performance. Beyond that, I'd need to see a sample workbook. Here's how you might gain a bit:
    Please Login or Register  to view this content.
    If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
    Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...

    Thomas Lafferty
    Analyst/Programmer

  3. #3
    Registered User
    Join Date
    10-05-2011
    Location
    Des Moines, Iowa
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Macro Tied to Complex Nested If Statement Extremely Inefficient/Slow - HELP

    Quote Originally Posted by tlafferty View Post
    Welcome to the forum! Without seeing your workbook, I'd suggest turning on and off screen updating and calculation at strategic points. This may gain you a bit of performance. Beyond that, I'd need to see a sample workbook. Here's how you might gain a bit:
    Please Login or Register  to view this content.
    I have screen updating off and I cannot run the macro with the auto calc. off. Each subsequent calculation depends on the one before it.

    Here is an example of the macro code changing the value of the cell:
    Please Login or Register  to view this content.
    In this spreadsheet, the loop effects cell C3 by adding to it until one of the percentages in column C reaches a certain designated percent (Please see VBA Help 2 Attached).

    This spreadsheet shows the nested ifs. Cell C3 of the previous worksheet filters into column F which cascades through the rest of the worksheet (Please see VBA Help 1 Attached).

    Thanks again! I cannot figure this out....
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    10-05-2011
    Location
    Des Moines, Iowa
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Macro Tied to Complex Nested If Statement Extremely Inefficient/Slow - HELP

    Does anyone need any more information on this question?

    Any and all ideas could help push me in the right direction.

    Thanks!

+ 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