تفضل يا اخى المبرمج هذا الكود لو عندك ارقام كتيير وعايز تعرف الرقم الاقل فيهم يبقى اى رقم من ارقام المصفوفه هذا الكود يعمل لك ما تريد
جرب ولا تتردد
شريف،،،
;) ;) :D
Public Function GetLessNum(ByRef Matrex() As Double) As Double On Error Resume Next Dim Count1 As Double, Count2 As Double, Count3 As Long, Count4 As Long, Matre() As Double, CHEK(12) As Boolean, STR1 As String, STR2 As String Count1 = LBound(Matrex) Count2 = UBound(Matrex) ReDim Matre(Count1 To Count2) As Double For Count3 = Count1 To Count2 Matre(Count3) = Matrex(Count3) Next For Count3 = Count1 To Count2 If Matre(Count3) = 0 Then Matre(Count3) = Val(100000 * 10000) Next For Count3 = Count1 To Count2 If Matre(Count3) <= Matre(Count3 + Val(Count2 - Count3 - 12)) And _ Matre(Count3) <= Matre(Count3 + Val(Count2 - Count3 - 11)) And _ Matre(Count3) <= Matre(Count3 + Val(Count2 - Count3 - 10)) And _ Matre(Count3) <= Matre(Count3 + Val(Count2 - Count3 - 9)) And _ Matre(Count3) <= Matre(Count3 + Val(Count2 - Count3 - 8)) And _ Matre(Count3) <= Matre(Count3 + Val(Count2 - Count3 - 7)) And _ Matre(Count3) <= Matre(Count3 + Val(Count2 - Count3 - 6)) And _ Matre(Count3) <= Matre(Count3 + Val(Count2 - Count3 - 5)) And _ Matre(Count3) <= Matre(Count3 + Val(Count2 - Count3 - 4)) And _ Matre(Count3) <= Matre(Count3 + Val(Count2 - Count3 - 3)) And _ Matre(Count3) <= Matre(Count3 + Val(Count2 - Count3 - 2)) And _ Matre(Count3) <= Matre(Count3 + Val(Count2 - Count3 - 1)) And _ Matre(Count3) <= Matre(Count3 + Val(Count2 - Count3)) _ Then CHEK(Count3) = True Else CHEK(Count3) = False End If Next For Count3 = Count1 To Count2 If CHEK(Count3) = True Then GetLessNum = Matrex(Count3) Exit For End If Next End Function
شريف،،،
;) ;) :rolleyes:

