Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you very much for your advice and time. I took your original suggestion
and embedded it in my routine and added a couple if statements to "filter out" unwanted results and it works great. Thanks again. "Gary Keramidas" wrote: how about this? it sorts the array and the lowest number will be arr(0) modified from someone's code here Sub sort_array() Dim arr As Variant Dim i As Long, j As Long, temp As Long 'sort the array arr = Array(2, 3, 4, 1, 6, 8,7) For i = LBound(arr) To UBound(arr) - 1 For j = i + 1 To UBound(arr) If arr(i) arr(j) Then temp = arr(j) arr(j) = arr(i) arr(i) = temp End If Next j Next i MsgBox arr(0) End Sub -- Gary "Sandy" wrote in message ... I have an array with let's say 10 numeric values. How can I finf the lowest non zero value and its position in the array. Thank you |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|