Solver can be used for example to fit a model like a line (y=mx+b) to a data set (X,Y) using solver to minimize the sum of the square of the difference between the model Y's and the data Y's by changing the slope and intercept, m and b. Here the model calculations are made on a sheet using Ymodel = m*X+b at every X.
But what if VBA was used to generated the model data? Can solver still be exploited for its utility?
Reason:
I have VBA code that generates model data but its too complicated to easily do in a spreadsheet so I run the macro to generate and output these numbers. That is, if I changed a parameter sort of equivalent to the "m" and "b" above, I must run the VBA code to generate new Ymodel values.
I'm curious if solver can be used in a macro when the relationship between "the values its changing" and the value its "minimizing, maximizing, or driving to value" has to be updated thru a VBA routine since they are not linked in a direct way through expressions on a sheet?
Hope the inquiry is clear enough. Thanks.
-- removed inline image ---
But what if VBA was used to generated the model data? Can solver still be exploited for its utility?
Reason:
I have VBA code that generates model data but its too complicated to easily do in a spreadsheet so I run the macro to generate and output these numbers. That is, if I changed a parameter sort of equivalent to the "m" and "b" above, I must run the VBA code to generate new Ymodel values.
I'm curious if solver can be used in a macro when the relationship between "the values its changing" and the value its "minimizing, maximizing, or driving to value" has to be updated thru a VBA routine since they are not linked in a direct way through expressions on a sheet?
Hope the inquiry is clear enough. Thanks.
-- removed inline image ---