+ Reply to Thread
Results 1 to 2 of 2

Help with Solver Code

Hybrid View

  1. #1
    Paul
    Guest

    Help with Solver Code

    I am using a solver reference in my code like this:

    SolverOk SetCell:="$c$22", MaxMinVal:=3, ValueOf:="0", ByChange:="$c$18"
    SolverSolve (True)

    However I need to do this repetitively so I would like to change $c$22 to
    something like (looper+5,5). However, when I try to use a cell reference like
    that, I get an error message. Thanks for the help.


    --
    Paul

  2. #2
    Michael Bednarek
    Guest

    Re: Help with Solver Code

    On Fri, 13 May 2005 11:32:02 -0700, "Paul" <[email protected]> wrote in microsoft.public.excel.programming:

    >I am using a solver reference in my code like this:
    >
    >SolverOk SetCell:="$c$22", MaxMinVal:=3, ValueOf:="0", ByChange:="$c$18"
    > SolverSolve (True)
    >
    >However I need to do this repetitively so I would like to change $c$22 to
    >something like (looper+5,5). However, when I try to use a cell reference like
    >that, I get an error message. Thanks for the help.


    Maybe this can help:
    strCell = Cells(looper + 5, 5).Address
    SolverOk SetCell:=strCell, MaxMinVal:=3, ValueOf:="0", ByChange:="$c$18"
    or shorter:
    SolverOk SetCell:=Cells(looper + 5, 5).Address, MaxMinVal:=3, ValueOf:="0", ByChange:="$c$18"

    Depending on your circumstances, you may need to qualify Cells().

    --
    Michael Bednarek http://mbednarek.com/ "POST NO BILLS"

+ 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