Hello folks,
I have a function where I pass numbers from a table, and I want to compare them and return the largest horizontal value. I store them in an array, and try the DMAX function on it, but get stuck there.
Any suggestions on how to achieve this, with arrays or otherwise?
I have a function where I pass numbers from a table, and I want to compare them and return the largest horizontal value. I store them in an array, and try the DMAX function on it, but get stuck there.
Code:
Function landuse(dblmips As Double, dblcie As Double, dblmed As Double, _
dblpdr As Double, dblret As Double, dblvis As Double)
Dim varsqft(5) As Double
Dim varlargest As Double
varsqft(0) = dblmips
varsqft(1) = dblcie
varsqft(2) = dblmed
varsqft(3) = dblpdr
varsqft(4) = dblret
varsqft(5) = dblvis
'the problem seems to be the next line
varlargest = DSum(varsqft)
landuse = varlargest
End Function
Comment