I've written an iterative numerical integration Sub which works fine. Several arguments are passed to it (cell references).
I now wish to incorporate Solver in the code process so that it reads the integration result, changes the values of two of the argument cells, after which the integration routine runs again, Solver changes the cells again, etc, until the integral is minimised.
Overall:
1. Initial values are set up as the arguments.
2. The integration routine then iteratively calculates the integral, based on the passed arguments.
3. Solver reads the integration result, then changes two of the argument cells.
4. Steps 2 and 3 repeat until Solver determines the integral result found at step 2 has been minimised.
(The final values of the changing cells (arguments) are then used for other things.)
I am unable to define the structure of the VBA code to achieve this.
I call the integration Sub, then call Solver, but Solver does a single pass only.
How do I get the integration sub and Solver to be repeatedly called, until the minimum integral value is found, after which the result is passed back to a cell, and the code terminates?
Bookmarks