N
neil
Hi,
I've been trying to find a value in array (within a Function). This
should be quite easy and straightforward, but I'm obviously going wrong
somewhere...
I'm looping through an array, and trying to match a value (passed as a
variant to the function) within the array.
Code:
[gY = value passed to function]
****************************************************************
dim yield(20) as variant, gilt_index as variant, i as Long
yield(0) = 3
.........................................(1)(2), etc
yield(20) = 8
For i = LBound(yield) To UBound(yield)
If gY = yield(i) Then gilt_index = yield(i)
Next
********************************************************************************
Within this loop, I can never match the value (gY) to a value in the
array, even though I know it is in the array. It simply does not match
it.
Any thoughts? This is driving me nuts...
(p.s. I'm using Office 2000)
Thanks
Neil.
I've been trying to find a value in array (within a Function). This
should be quite easy and straightforward, but I'm obviously going wrong
somewhere...
I'm looping through an array, and trying to match a value (passed as a
variant to the function) within the array.
Code:
[gY = value passed to function]
****************************************************************
dim yield(20) as variant, gilt_index as variant, i as Long
yield(0) = 3
.........................................(1)(2), etc
yield(20) = 8
For i = LBound(yield) To UBound(yield)
If gY = yield(i) Then gilt_index = yield(i)
Next
********************************************************************************
Within this loop, I can never match the value (gY) to a value in the
array, even though I know it is in the array. It simply does not match
it.
Any thoughts? This is driving me nuts...
(p.s. I'm using Office 2000)
Thanks
Neil.