Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Automatic Solver

(1) Suppose cell C1 is a complicated formula (objective function)
which depends on B1 (a parameter) and A1 (a variable)

(2) For every value of B1 suppose there is an A1 which maximizes C1.
Is there a way that whenever I change B1, the value of A1
automatically changes so that C1 is maximized.

I know how to find any new A1 corresponding to a new B1 by using
solver. But I have to go and do this manually.

I really appreciate any help.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Automatic Solver

Record a macro that runs Solver solving A1.

Then use the Worksheet_Change event to call the macro whenever B1 is
changed.

Hth,
Merjet


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Automatic Solver

Solver normally requires a final value for it to solve for. Since this
is not quite what you are wanting, then you will have to write a
routine to do this search. I created a workbook, just for fun, that
employs the "Golden Section" search method that I remember from
college many years ago. The code is a little over 100 lines, so is a
little big to post here, but I will send it to you for you to look
over. I included some extra "goodies" also: a separate worksheet to
"log" each value of the iteration, and a chart sheet to plot the
points.

You need to give the routine an upper and a lower limit for the values
in cell A1, so I put those in cells A2 and A3. It uses a button to
start the macro, rather than automatically calling the routine from
the worksheet Change event, but you could add this call very easily.
This allows one to enter various values in cell A1 to verify the
formula in cell C1, then push the button to find the value of A1 that
will maximize the value of C1. I used a parabola for the function in
cell C1. Just change cell C1 to your function.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Solver Function - Making it Automatic JamesB Excel Worksheet Functions 9 April 3rd 23 01:21 PM
How to replace Excel solver with some free solver codes in Excel V ct2147 Excel Programming 2 November 8th 06 07:06 PM
Automatic use of Solver in an Excel model Jasper[_2_] Excel Programming 1 May 11th 06 01:29 PM
Interesting Solver problem (Solver encounters an error) MrShorty Excel Discussion (Misc queries) 3 December 22nd 05 10:52 PM
Resetting Solver Manually to Fix Solver Bug Stratuser Excel Programming 0 September 13th 04 07:04 PM


All times are GMT +1. The time now is 05:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"