Results 1 to 9 of 9

Functions inside Solver algo

Threaded View

  1. #1
    Registered User
    Join Date
    07-25-2009
    Location
    New York City, USA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Functions inside Solver algo

    Hey guys, I have an array of quantities in my VBA code that i want to change to maximiaze a value. I am having trouble incorporating the VBA function into the solver methodology. I am currently copying these the quantities back and forth from the function to the worksheet and then clicking a button that solves the worksheet values by calling the function..... only it doesn't work yet!

    Part of below is pseudo code:



    Private Sub DoSolver()   '  Called by button click in worksheet
    
    SolverOK StartCell:= "A1", MaxMinVal:=1, ValueOf="0", ByChange:="quantities"
    ' I then add a couple of  constraints on worksheet range  "quantities"
    RunVBAFunction
    SolverSolve(true) 
    
    End Sub

    Inside RunVBAFunction it sets the worksheet values to the array that is used in RunVBAFunction. It also then prints out a formula and value to the "A1" cell that is being maximized. The function runs correctly and spits out a value correctly to the workshet... but it is only called once though, and no itterative process occurs. I also tried putting this solver process in a loop but there was not maximination going on.

    Please help, thanks in advance!!!
    Last edited by Zward25; 07-26-2009 at 03:21 PM.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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