Closed Thread
Results 1 to 2 of 2

Passing a function in to solver

  1. #1
    Registered User
    Join Date
    07-12-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    1

    Passing a function in to solver

    Hi All

    I have the following code for a function: Please read below

    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    Function optimise(a, b, c As Integer) As Double

    Dim i, j As Integer

    Dim d, f As Integer
    Dim h As Double

    ReDim e(c, 4) As Variant

    ReDim g(c) As Variant

    h = 0

    i = 1
    j = 1

    For f = 1 To 4

    For d = 1 To c
    e(d, f) = a(i).Formula

    i = i + 1

    h = h + e(d, f)

    Next d

    Next f

    For d = 1 To c

    g(k) = b(j).Formula

    Next d

    optimise = h


    End Function


    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    What I want to do is get the data from the function in to solver.

    Any help would be much appreciated.

    Thanks

    G

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Passing a function in to solver

    Welcome to the forum.

    Please take a few minutes to read the forum rules, and then edit your post to add CODE tags.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

Closed 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