ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Solver formula "Equal to Value of:" cell reference (https://www.excelbanter.com/excel-discussion-misc-queries/225400-solver-formula-equal-value-cell-reference.html)

ORLANDO VAZQUEZ[_2_]

Solver formula "Equal to Value of:" cell reference
 
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.

--
Orlando Vazquez

ORLANDO VAZQUEZ[_2_]

Solver formula "Equal to Value of:" cell reference
 
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

--
Orlando Vazquez


"ORLANDO VAZQUEZ" wrote:

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.

--
Orlando Vazquez


Bernard Liengme[_3_]

Solver formula "Equal to Value of:" cell reference
 
An untested suggestion

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

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email


"ORLANDO VAZQUEZ" wrote in
message ...
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

--
Orlando Vazquez


"ORLANDO VAZQUEZ" wrote:

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.

--
Orlando Vazquez





All times are GMT +1. The time now is 01:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com