Solver formula "Equal to Value of:" cell reference

reddy888

New Member
Joined
Jan 6, 2011
Messages
15
Is there a way I can use Solver in a vba formula so that the "Value of" value equals a cell reference? I need to run across solver function across several names. Assuming value of is in Column B, and Changing cells in column C.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
below is the macro i came up with but was not able to get the right Cell reference for Valueof..I appreciate your timely response. Thanks in advance!!

Sub MacroSolve()
Worksheets("Sheet1").Activate
Rowcount = 19
Do While Not IsEmpty(Worksheets("Sheet1").Range("A" & Rowcount))
SolverReset
SolverOptions precision:=0.001
SolverOk SetCell:=Range("H" & Rowcount), _
MaxMinVal:=3, _
ValueOf:=Range("A" & Rowcount), _
ByChange:=Range("G" & Rowcount)
SolverSolve userFinish:=True
SolverFinish keepFinal:=1
Rowcount = Rowcount + 1
Loop
MsgBox "processing over"
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,568
Messages
6,179,595
Members
452,927
Latest member
whitfieldcraig

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top