View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
SteveM SteveM is offline
external usenet poster
 
Posts: 133
Default optimisation tool for objective function macro

wjm,

The macro won't work because the target cell is a function of the
decision variables which are cell references. E.g., if your objective
function is to min cost then then the target cell is the sumproduct of
the decision variables and the cost coefficients. (But you know this.)

Can you tell what about your objective function prevents you from
formulating it on a worksheet?

SteveM



wjm wrote:
SteveM,

I don't think I have explained my problem sufficiently well.

Solver requires a target cell (which has the value of the objective
function - normally calculated by a formula within the cell) and
changing cells (which are the variables to be optimised). The only way
I can define my objective function is through a macro. Therefore the
value in the target cell must be provided by my Macro and not a formula
in the cell. To provide the value in the target cell the macro reads the
values of the changing cells (optimisation variables) and runs the
macro.

Solver requires the target cell to contain a formula, which is probably
the first indication that I can't use a macro instead of a formula in
the target cell. Can Solver or an alternative code or add-in work with
an objective function calculated by a macro and not by a fromula in the
target cell?

Hope this make sense?

Regards,

Will


--
wjm
------------------------------------------------------------------------
wjm's Profile: http://www.excelforum.com/member.php...o&userid=35136
View this thread: http://www.excelforum.com/showthread...hreadid=548962