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