Copy data from solver answer to different cells

dorkas

New Member
Joined
Jun 12, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi Everybody I want help with the vba of the macro below, the idea is to loop through data and then paste the answers to a different part. It is an attempt to optimize fertilizer cost for various gps points as part of a precision Agrculture project , See outlay below:

'
' SOLVER1 Macro
'

'
SolverOk SetCell:="$H$6", MaxMinVal:=2, ValueOf:=0, ByChange:="$H$8:$H$22", _
Engine:=2, EngineDesc:="Simplex LP"
SolverAdd CellRef:="$B$4:$G$4", Relation:=3, FormulaText:="$B$3:$G$3"
SolverOk SetCell:="$H$6", MaxMinVal:=2, ValueOf:=0, ByChange:="$H$8:$H$22", _
Engine:=2, EngineDesc:="Simplex LP"
SolverOk SetCell:="$H$6", MaxMinVal:=2, ValueOf:=0, ByChange:="$H$8:$H$22", _
Engine:=2, EngineDesc:="Simplex LP"
SolverSolve
End Sub

If I run the solver( not cleaned) it returns the answer to H6( the minimized costs), and the amount or optimized fertilizer amounts to (H8:H22), I want to automatically select, the nutrient requirement(C25 : H25) then , run the solver and past the data alternatively to (L7 : Z7) ( OPTIMIZED COSTING) and the amounts of fertilizers to(L8:Z22) with each run...

Thanks for your time

dorkas

currently
Capture.PNG
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,214,985
Messages
6,122,602
Members
449,089
Latest member
Motoracer88

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