+ Reply to Thread
Results 1 to 2 of 2

Solver + Macro

  1. #1
    Registered User
    Join Date
    06-21-2020
    Location
    Bangalore
    MS-Off Ver
    16
    Posts
    1

    Question Solver + Macro

    Hi Everyone,

    I have a solver objective function that is getting calculated in a macro. I need to tie up these two solutions.

    Objective function = max(cell)

    this cell is populated using a macro

    So, every time variable inputs change- macro should run to repopulate the column and then check if the cell value is maximized.

    Please help if you have solved something similar.

    Thanks,
    Nupoor

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: 2019 but still use also older versions
    Posts
    7,463

    Re: Solver + Macro

    if a cell you want to maximize is populated by macro, not by an excel function you basically cannot use solver.

    You can try to fool the solver and instead of just macro use UDF (user defined function, so basically still VBA code) with Volatile statement inside.

    Then Solver will call it and change output value accordingly.

    See the example file (make sure macros are allowed) and run solver.
    Attached Files Attached Files
    Best Regards,

    Kaper

+ 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: 2
    Last Post: 06-22-2020, 03:14 PM
  2. Replies: 1
    Last Post: 04-27-2016, 03:05 PM
  3. Replies: 0
    Last Post: 07-20-2014, 12:45 PM
  4. macro not keeping solver solutions when solver is successful
    By jimmypants in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2014, 01:45 AM
  5. Can't start Solver. Error message says Solver.xlam already open.
    By DaveHills in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 1
    Last Post: 10-21-2012, 11:02 AM
  6. solver macro + simulation code + not updating solver values
    By sabinemaria in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2012, 11:37 AM
  7. lookup macro, solver macro, realtime macro
    By xelhelp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2011, 06:14 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