Results 1 to 2 of 2
  1. #1
    jjabarry
    Guest

    Excel Solver in VBA? (Excel 2000)

    Does anyone have an example code of how to include the Solver function in a macro and can you set up some variables where a message box asks for the target cell and the cell you want to change to approach the value of interest. In other words, get cell B1 to match A1 by changing cell C1.
    Thanks

  2. #2
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Excel Solver in VBA? (Excel 2000)

    jjabarry

    I tried to record while I was working with solver and here is what I got:

    <font color=red>
    SolverOk SetCell:="$A$2", MaxMinVal:=1, ValueOf:="0", ByChange:="$A$1,$A$6"
    SolverSolve
    </font color=red>


    I hope I gave you an example...

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •