hi all have the following code and as usual can't figure out where the problem is. getting compile error sub or function not defined. any help appreciated.
Regards
Dan
![]()
Please Login or Register to view this content.
hi all have the following code and as usual can't figure out where the problem is. getting compile error sub or function not defined. any help appreciated.
Regards
Dan
![]()
Please Login or Register to view this content.
Last edited by Cicada; 04-25-2012 at 12:32 PM. Reason: Solved
Could this be your problem?
AlfBefore you can use the Solver VBA functions in the Visual Basic Editor, you must establish a reference to the Solver add-in. In the Visual Basic Editor, with a module active, click References on the Tools menu, and then select Solver under Available References. If Solver does not appear under Available References, click Browse, and then open Solver.xlam in the \Program Files\Microsoft Office\Office14\Library\SOLVER subfolder.
Thanks Alf that was it. Thanks for your help. When i run it now i am getting the popup solver could not find a feasible solution which is fine though could i add something to that code to prevent this popup from appearing. secondly the initial call is not working when I run it it solves automatically even though there is no "y" in j14. Any ideas what i am doing wrong. Thanks again
Regards
Dan
Not familiar with Solver in Excel 2010 but this line puzzles me
As far as I know you either use the "Simplex method" (engine1) or the "GRG Nonlinear" (engine2) but this looks to me like both methods are called. Still I'm unsure if this is the problem.![]()
Please Login or Register to view this content.
Could you just test that the macro "Freeme" fires only when you add a "Y" to cell J14 i.e. a code snippet that makes "Freeme" just writes "Ok" to a cell.
Or you could upload the file.
Alf
This code runs solver when a value is entered in J14
Works for Excel 2003 and 2007 don't know about Excel 2010. Not exactly what you asked for i.e. you wanted the target value to be "Y" as well but at least it only fires when a value is entered in J14. All other inputs ignored.![]()
Please Login or Register to view this content.
Alf
Thanks Alf for your time much appreciated. got it sorted.
Regards
Dan
Hi Dan
Glad you got your problem sorted out. Just out of curiosity and a whish to learn more could you please post your solution?
Alf
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks