Solver formula "Equal to Value of:" cell reference

O

ORLANDO VAZQUEZ

Hi !

Is there a way I can use Solver in a vb formula so that the "Value of" value
equals a cell reference?

Thank you.
 
O

ORLANDO VAZQUEZ

For example, the ValueOf:= below should reference a cell on the spreadsheet
that contains the value instead of having to type in the value.

Sub solvit()
SolverReset
SolverOk SetCell:=("J16"), MaxMinVal:=3, ValueOf:=0.0125, ByChange:=("N16")
End Sub
 
B

Bernard Liengme

An untested suggestion

Sub solvit()
SolverReset
val =Range("N16)
SolverOk SetCell:=("J16"), MaxMinVal:=3, ValueOf:=val, ByChange:=("N16")
End Sub

best wishes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top