Originally posted by: Yeahoos
I guess I wasn't able to post my workbook. Here is the macro:
Sub Example()
CPXclear
CPXaddVariable Variable:=ActiveSheet.Cells(5, 3), Lb:=4, Ub:=6
CPXsetObjective ObjCell:=ActiveSheet.Cells(6, 3), Sense:=2
CPXsolve
End Sub
The sheet has a values of 34, 0, and 12 in C1, D1, and E1, resp. Cell C4 has the formula "=0.2/(SUM(C2:E2)+1)". Cell C6 has the formula "=C4*C5".
#CPLEXOptimizers#DecisionOptimization