LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 407
Default Interacting with EXCEL Solver via macro

I want to create a macro that will invoke EXCEL's Solver. All I am doing is
setting a target cell (always in the same location) to a value by changing
another cell, which is always in the same location. I know how to write
macros mostly by recording. All that I need to do is record such a sequence.
But, then, since the number I will be setting the target cell to will
change, I need a way for the macro to know to let me enter a value, and
then, I guess, let me hit enter, which should then allow the macro to finish
up with the solver, by accepting the solution.

Can someone tell me what I have to do? Here is my recorded macro. assuming
that, this time, the target was too be set to 1,922,750

Sub Macro3()
'
' Macro3 Macro
' Macro recorded 1/22/2005 by Dean
'

'
SolverOk SetCell:="$M$62", MaxMinVal:=3, ValueOf:="1922750",
ByChange:="$I$62"
SolverSolve
End Sub

Though the above request would be good enough, the "value of" that I will
want to set it to is always the result of a formula that is in another
specific cell, one to the right of the target cell, in this case, cell
$N$62. If there was a way to have the macro find that formula's value and
type that formula's value into the solver "value of" box itself, that would
be even better, as there would be no manual intervention.

Can anyone help me with the first, if not (even better) the 2nd approach?

Thanks much!
Dean


 
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
Interacting with 2 different excel files Trups Excel Discussion (Misc queries) 0 August 9th 07 04:52 AM
Problem interacting between VB.NET and VBA6 with Excel 2003 Nicholas Dreyer Excel Discussion (Misc queries) 0 April 6th 07 04:07 AM
excel solver macro Hannu Rantala Excel Programming 2 April 5th 04 05:33 AM
macro using excel solver Hannu Rantala Excel Programming 0 April 2nd 04 09:20 AM
Interacting outside Excel Kevin Excel Programming 1 March 2nd 04 02:38 AM


All times are GMT +1. The time now is 08:50 AM.

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"