You are welcome and thanks for feedback 
What I would like to optimize was the AI column by changing the P and the R.
Well you did that by setting the command "MaxMinVal:=2," i.e. this solver "translates" as sett (AI + i) values to min by changing cells (P + i) and cells (R + i)
and then you specify that cells (AI + i) should be equal to cells (AI + i) using the "SolverAdd CellRef:=Cells(i, "AI").Address, Relation:=2, FormulaText:=Cells(i, "AI").Address"
This is the part I don't understand.
The formula in the cells (AI + i) say in cell AI24
refers to cells that have no value in the uploaded file so changing cells (P + i) and cells (R + i) will have no effect when I run the macro. That I have no problem with and it could be that when all these cells have values then then the setting cells (AI + i) = cells (AI + i) make sense.
But if you are happy with the macro modification then I'm happy too.
Alf
Ps If this solves your problem don't forget to mark your thread "Solved" as per Forum rules
To mark your thread solved do the following:
-Go to the top of the first post
-Select Thread Tools
-Select Mark thread as Solved
Bookmarks