+ Reply to Thread
Results 1 to 9 of 9

Macro running but not calculating any new values

  1. #1
    Registered User
    Join Date
    08-02-2017
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2010
    Posts
    20

    Macro running but not calculating any new values

    Hi all, first time posting on the forum, Hope I don't break any of the rules

    I've made a Solver Loop with one constraint, which runs, but doesn't change any of the values it should. There are no error messages so I haven't a clue how to fix it. Thanks in advance

    Here is my code:

    Please Login or Register  to view this content.
    Last edited by macronoob1; 08-02-2017 at 08:56 PM.

  2. #2
    Registered User
    Join Date
    08-02-2017
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2010
    Posts
    20

    Re: Macro running but not calculating any new values

    The CODE tag has now been applied, apologies for not having done so to begin with

  3. #3
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Macro running but not calculating any new values

    Perhaps this will work better?

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    08-02-2017
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2010
    Posts
    20

    Re: Macro running but not calculating any new values

    Works perfectly! Thank you sir.

    Do you know what the issue was with my code, for my future reference?
    Last edited by macronoob1; 08-02-2017 at 08:58 PM.

  5. #5
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Macro running but not calculating any new values

    You are welcome and thanks for feedback

    What your macro was missing the command to run solver i.e.
    Please Login or Register  to view this content.
    I also dim'ed i as an integer. Not essential but makes macro a tad faster as excel then knows what i is supposed to be instead of guessing.

    Not really sure about your line
    Please Login or Register  to view this content.
    as solver only works on the active sheet. This is a build in feature of solver as it makes solver work faster.

    Alf

    Ps as this seems to solve you problem don't forget to mark this thread "Solved"

    To mark your thread solved do the following:

    -Go to the top of the first post
    -Select Thread Tools
    -Select Mark thread as Solved

  6. #6
    Registered User
    Join Date
    08-02-2017
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2010
    Posts
    20

    Re: Macro running but not calculating any new values

    I can't see the thread tools option for some reason, is there another way I can mark as solved?

  7. #7
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Macro running but not calculating any new values

    is there another way I can mark as solved?
    No problem, I can ask a Moderator to fix it but have you checked you other threads. Is it the same with these or is it just this thread?

    Could it be a setting problem?

    This is what I see when I click the drop-down arrow on "Thread Tools"

    asolved.jpg

    Alf

  8. #8
    Registered User
    Join Date
    08-02-2017
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2010
    Posts
    20

    Re: Macro running but not calculating any new values

    I don't have any of those options at the top

  9. #9
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Macro running but not calculating any new values

    Problem reported

    https://www.excelforum.com/the-water...-solved-9.html

    See post #126 and hopefully you will get some feedback on your problem.

    Alf
    Last edited by Alf; 08-04-2017 at 03:26 AM.

+ 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. Replies: 10
    Last Post: 02-12-2014, 04:14 AM
  2. [SOLVED] Macro Stops running after paste values
    By mhawkins91 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-12-2014, 05:23 PM
  3. [SOLVED] Macro is running but not entering values into cells!
    By nicd88 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-11-2013, 08:25 AM
  4. Running Macro with Do Loop of similar based on values in a Column
    By fishycarl in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-11-2013, 03:50 AM
  5. [SOLVED] Run-time error 1004 when running Advanced Filter for Unique Values in macro
    By jacobadger in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-17-2012, 02:17 PM
  6. Running macro only if linked cell are updated with values
    By surajms in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-17-2012, 11:24 AM
  7. Macro running slowly, copy/paste values only from one workbook to another
    By Jeanette White in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-24-2012, 09:42 AM
  8. Running a Macro off Data Validation Values
    By Sky188 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-11-2012, 04:02 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