+ Reply to Thread
Results 1 to 2 of 2

Solver in macros

  1. #1
    Traima
    Guest

    Solver in macros

    How is it possible to create a macro that uses Solver to calculate a target
    cell, by changig the value of an inputbox?


    So far I have recorded the solver code like this:

    SolverOK SetCell:="$H$25", MaxMinVal:=3, ValueOf:=Nettverk, ByChange:="$C$16"

    Nettverk is defined as the value of the inputbox. What am I missing to
    complete this?

  2. #2
    Dana DeLouis
    Guest

    Re: Solver in macros

    Just for feedback, your code worked ok for me using a simple model.

    Your code worked ok for me

    Sub Demo()
    Dim Nettverk
    Nettverk = InputBox("Value")
    SolverOK SetCell:="H25", MaxMinVal:=3, ValueOf:=Nettverk,
    ByChange:="C16"
    SolverSolve True
    End Sub

    This worked ok also:

    Sub Demo2()
    SolverOK SetCell:="H25", MaxMinVal:=3, ValueOf:=InputBox("Value"),
    ByChange:="C16"
    SolverSolve True
    End Sub


    --
    Dana DeLouis
    Win XP & Office 2003


    "Traima" <[email protected]> wrote in message
    news:[email protected]...
    > How is it possible to create a macro that uses Solver to calculate a
    > target
    > cell, by changig the value of an inputbox?
    >
    >
    > So far I have recorded the solver code like this:
    >
    > SolverOK SetCell:="$H$25", MaxMinVal:=3, ValueOf:=Nettverk,
    > ByChange:="$C$16"
    >
    > Nettverk is defined as the value of the inputbox. What am I missing to
    > complete this?




+ 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