Hey guys, I have an array of quantities in my VBA code that i want to change to maximiaze a value. I am having trouble incorporating the VBA function into the solver methodology. I am currently copying these the quantities back and forth from the function to the worksheet and then clicking a button that solves the worksheet values by calling the function..... only it doesn't work yet!
Part of below is pseudo code:
Private Sub DoSolver() ' Called by button click in worksheet
SolverOK StartCell:= "A1", MaxMinVal:=1, ValueOf="0", ByChange:="quantities"
' I then add a couple of constraints on worksheet range "quantities"
RunVBAFunction
SolverSolve(true)
End Sub
Inside RunVBAFunction it sets the worksheet values to the array that is used in RunVBAFunction. It also then prints out a formula and value to the "A1" cell that is being maximized. The function runs correctly and spits out a value correctly to the workshet... but it is only called once though, and no itterative process occurs. I also tried putting this solver process in a loop but there was not maximination going on.
Please help, thanks in advance!!!
Bookmarks