Using external subroutine in Solver (in VBA)

abc500007

New Member
Joined
Jan 18, 2016
Messages
1
Hello,

I am fairly new to using Solver in VBA, hence the question.

I have a subroutine which implements an algorithm to print the final results (10 values in 10 different cells). The results depend on 6 assumed parameters within the algorithm. I was planning to use Solver to optimize on these assumed parameters, in order to arrive at the exact results (10 values) I want to achieve. From my understanding, Solver can be used in Excel if the cells referenced in 'Set Objective' have a formula. Can we also use Solver if the cells referenced in 'Set Objective' do not have a formula but are the results from a subroutine in excel VBA.

I would be using the following logic:
1. 'SolverAdd' to add the 6 parameters and set constraints on them.
2. Use the algorithm (instead of a cell formula) to arrive at the results (10 values). Compare with the required results I am hoping to achieve.
3. Use solver to change the 6 parameters.
4. Iterate between 2 and 3 to get the required results.

It would be great if someone can let me know whether this can be done using Solver, OR if there is a different tool in Excel that I can make use of. Any suggestions are appreciated.

Thank you,
VJ
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Forum statistics

Threads
1,215,473
Messages
6,125,022
Members
449,203
Latest member
tungnmqn90

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