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

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,214,970
Messages
6,122,514
Members
449,088
Latest member
RandomExceller01

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