+ Reply to Thread
Results 1 to 3 of 3

Using a variable in solver

  1. #1
    Stephen
    Guest

    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. #2
    Dana DeLouis
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    >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. #3
    Stephen
    Guest

    RE: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1