A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Hi.
(1) In the vba editor, go to "Tools" / "References..." and check "Solver".
This adds the Solver code stuff to Excel vba.
(2) Here's a simple way to do it. No error checking, or any constraints.
My preference is to just reset Solver in a loop.
In a Minimization problem, "valueof" is not required.
Sub Demo()
Dim Cell As Range
For Each Cell In [C21:X21].Cells
SolverReset
SolverOk Cell.Address, 2, , Cell.Offset(1, 0).Resize(3, 1).Address, 1
SolverSolve True
Next Cell
End Sub