Ok so this is the code I am using now:
Option Explicit
Sub Makro2()
Dim i As Long
Dim j As Long
For j = 4 To 20
For i = 56 To Range("D" & Rows.Count).End(xlUp).Row
SolverReset
SolverOk SetCell:=Cells(i, j).Address, MaxMinVal:=3, ByChange:=Range(Cells(41, i), Cells(44, i)), Engine:=1
SolverAdd CellRef:=Range(Cells(41, i), Cells(44, i)), Relation:=3, FormulaText:="0"
SolverAdd CellRef:=Range(Cells(48, i), Cells(51, i)), Relation:=2, FormulaText:="0"
SolverSolve Userfinish:=True
Next
Next
End Sub
There is definitely something happening BUT after I run the solver the values that needs to change in cells 41:44 on column range D:E do not change at all. As a result of this the values that I want to become zero in cells D56:E56 are anything but zero.
Bookmarks