Poppa Smurf
Registered User.
- Local time
- Tomorrow, 01:53
- Joined
- Mar 21, 2008
- Messages
- 448
Khalil
Using part of the code your minimum function as per previous post.
' Cycle through each value from the row to find the smallest.
For I = 0 To UBound(FieldArray)
If FieldArray(I) < currentVal Then
currentVal = FieldArray(I)
End If
Next I
To exclude 0 from the test we need to add an IF END IF statement to check for a zero in the FieldArray. This is done by adding IF FieldArray(I) > 0 then and END IF as ahown in the code below.
If the value in the FieldArray(I) is greater than 0 then the next 3 lines code are processed.
If the value in the FieldArray(I) is equal to 0 then the next thrre lines are not processed.
For I = 0 To UBound(FieldArray)
IF FieldArray(I) > 0 then
If FieldArray(I) < currentVal Then
currentVal = FieldArray(I)
End If
END IF
Next I
Using part of the code your minimum function as per previous post.
' Cycle through each value from the row to find the smallest.
For I = 0 To UBound(FieldArray)
If FieldArray(I) < currentVal Then
currentVal = FieldArray(I)
End If
Next I
I want to find the minimum number except zero and maximum number
To exclude 0 from the test we need to add an IF END IF statement to check for a zero in the FieldArray. This is done by adding IF FieldArray(I) > 0 then and END IF as ahown in the code below.
If the value in the FieldArray(I) is greater than 0 then the next 3 lines code are processed.
If the value in the FieldArray(I) is equal to 0 then the next thrre lines are not processed.
For I = 0 To UBound(FieldArray)
IF FieldArray(I) > 0 then
If FieldArray(I) < currentVal Then
currentVal = FieldArray(I)
End If
END IF
Next I