I don 't know how to NEXT when I have multiple "for" statements.
Since you have 3 "For" statement you need 3 "Next" and the way it will work is that the last "For" will be "solved" first.
So first p = 10, i = 11 and d = 2 and with this setup solver will do the first run, the second run will use the same p and i value but d will now be 3. For the 3 run d = 4 and p and i are still 10 and 11 and so forth until d = 8.
The next run after d = 8 the i value will change to 12 and the d value will start at 2 again loop through the d values 2 to 8, then change the i value to 13 and loop through all d values and so fort.
When the i = 17 the next loop change the p value to 11.
Solver will not understand SetCell:="(24,i)" so I've changed your code a bit. When writing code it should be wrapped click on the "#" icon and write your code between two [CODE] symbols you get.
In you code you wrote Engine:=1, EngineDesc:="GRG Nonlinear" this is not wrong but you only need to specify either "Engine:=1" or EngineDesc:="GRG Nonlinear"
Alf
Bookmarks