Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default Using a variable in solver

I am tring to use a macro so that a user can input a number into a call and
when the macro is run the solver references that cell.(e25 in this case.)
When I run the code it seems to default to the current settings in the solver
and not the referenced cell. I have tried resetting the values on the
solver. Anyone have any thoughts. Here is the code I am using:

SolverOk SetCell:="$B$25", MaxMinVal:=0.01, _
ValueOf:=Range("$e$25").Value, _
ByChange:="$B$22"
SolverSolve

Thanks.

Stephen
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 947
Default Using a variable in solver

SolverOk SetCell:="$B$25", MaxMinVal:=0.01, _
ValueOf:=Range("$e$25").Value, _
ByChange:="$B$22"


Hello. In your above code, "MaxMinVal" indicates what type of operation to
perform. If should not be set to 0.01 (just 1,2, or 3). See if using
MaxMinVal:=3 will work since you are trying to set B25 to a specific value .
--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"Stephen" wrote in message
...
I am tring to use a macro so that a user can input a number into a call and
when the macro is run the solver references that cell.(e25 in this case.)
When I run the code it seems to default to the current settings in the
solver
and not the referenced cell. I have tried resetting the values on the
solver. Anyone have any thoughts. Here is the code I am using:

SolverOk SetCell:="$B$25", MaxMinVal:=0.01, _
ValueOf:=Range("$e$25").Value, _
ByChange:="$B$22"
SolverSolve

Thanks.

Stephen



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default Using a variable in solver

THANKS! It works perfectly know.

"Stephen" wrote:

I am tring to use a macro so that a user can input a number into a call and
when the macro is run the solver references that cell.(e25 in this case.)
When I run the code it seems to default to the current settings in the solver
and not the referenced cell. I have tried resetting the values on the
solver. Anyone have any thoughts. Here is the code I am using:

SolverOk SetCell:="$B$25", MaxMinVal:=0.01, _
ValueOf:=Range("$e$25").Value, _
ByChange:="$B$22"
SolverSolve

Thanks.

Stephen

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 with binary variable maywood Excel Discussion (Misc queries) 0 December 22nd 09 10:02 AM
Multiple or Variable cell references in Solver (Excel 97) Coreyhotlin Excel Worksheet Functions 1 February 14th 06 01:36 PM
Interesting Solver problem (Solver encounters an error) MrShorty Excel Discussion (Misc queries) 3 December 22nd 05 10:52 PM
solver can not solve polynomial eq. where one variable is five di. Amitava Excel Worksheet Functions 4 November 3rd 04 12:34 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 10:10 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"