Excel Goal Seeker/Solver Macro RRS feed

  • Question

  • I have a excel spreadsheet with several worksheets.  One worksheet has a macro using goalseeker to calculate a value.  That value is copied into the next worksheet along with some other values and the next worksheet uses solver to calculate another value.  It appears that when I run the goal seeker macro, the solver macro is also run and to the users it appears the solver macro is not working because the correct answer is already display and pressing the macro button does not change an already correct answer.  Any help would be appreciated in solving this.  The macros are on two different worksheets and there is no code for one to call another.  I'm running Excel 2010 64 bit under Windows 7.
    Tuesday, September 18, 2012 2:42 PM


  • Hi,

    As my understanding this issue, you mean that, for example, there are two sheets (sheet1, sheet2), then there’s a macro named goalseeker in sheet1, then run goalseeker macro, you need solver macro to run in sheet2. Am I right? If what I understood is not correct, then could you share the workbook on https://skydrive.live.com/ (remove the sensitive information)

    If what I understood is correct, then I want to confirm that the value in sheet2 which copied from sheet1 is always pasted in the same cell/ range? If it is, then we can use Worksheet_Change() event to run the macro, and in the event, judge the target address first. If sheet2 will only change content via goalseeker macro, then we don’t need to judge the target address.

    Also, we can also call solver macro in goalseeker macro.

    Another suggestion, make a breakpoint in the solver macro, then check whether it runs into this macro.

    Jaynet Zhang

    TechNet Community Support

    • Marked as answer by Jaynet Zhang Saturday, September 22, 2012 1:02 AM
    Wednesday, September 19, 2012 6:12 AM