Dim tablo, min As Single, i As Integer, j As Integer tablo = Range("A1:J1").Value MsgBox UBound(tablo, 2) For i = 1 To UBound(tablo, 2) If IsNumeric(Replace(tablo(1, i), ".", ",")) And Val(tablo(1, i)) <> 0 Then min = Replace(tablo(1, i), ".", ","): Exit For End If Next For j = i To UBound(tablo, 2) If Val(tablo(1, j)) <> 0 Then If IsNumeric(Replace(tablo(1, j), ".", ",")) And Replace(tablo(1, j), ".", ",") < min Then min = Replace(tablo(1, j), ".", ",") End If End If Next MsgBox min
dim titi as range Set titi = Range("B1:B10") MsgBox WorksheetFunction.Min(titi.Value)
Dim tablo tablo = Range("B1:c10").Value Min = Val(tablo(1, 1)) For i = 1 To UBound(tablo) If Val(tablo(i, 1)) <> 0 And Val(tablo(i, 1)) < Min Then Min = tablo(i, 1) End If Next MsgBox Min
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questiontablo(i, 1)) <> ""
If Val(tablo(i, 1)) <> 0 And Val(tablo(i, 1)) < Min Then
Sub mini() Dim tablo tablo = Range("B1:b10").Value min = Val(tablo(1, 1)) For i = 1 To UBound(tablo) If IsNumeric(tablo(i, 1)) And Val(tablo(i, 1)) <> 0 And Val(tablo(i, 1)) < min Then min = tablo(i, 1) End If Next MsgBox min End Sub
Dim tablo, min As Single tablo = Range("B1:c10").Value min = CSng(tablo(1, 1)) For i = 1 To UBound(tablo) If CSng(tablo(i, 1)) <> 0 And CSng(tablo(i, 1)) < min Then min = CSng(tablo(i, 1)) End If Next MsgBox min
Dim tablo, min As String tablo = Range("B1:c10").Value min = "999999999.99" For i = 1 To UBound(tablo) If Val(tablo(i, 1)) <> 0 Then If Format(CSng(tablo(i, 1)), "00000000#.00") < min Then min = Format(CSng(tablo(i, 1)), "00000000#.00") End If End If Next MsgBox CSng(min)
Dim tablo, min As Single, i As Integer, j As Integer tablo = Range("B1:B10").Value For i = 1 To UBound(tablo) If IsNumeric(Replace(tablo(i, 1), ".", ",")) And Val(tablo(i, 1)) <> 0 Then min = Replace(tablo(i, 1), ".", ","): Exit For End If Next For j = i To UBound(tablo) If Val(tablo(j, 1)) <> 0 Then If IsNumeric(Replace(tablo(j, 1), ".", ",")) And Replace(tablo(j, 1), ".", ",") < min Then min = Replace(tablo(j, 1), ".", ",") End If End If Next MsgBox min
tablo = Range("A1:J1").Value
Sub mini() arrets = "" Set f = ActiveSheet For m = 1 To 10 If f.Cells(1, m) <> "" Then arrets = arrets & f.Cells(1, m) & ";" End If Next m
Sub mini() liste = "" Set f = ActiveSheet For m = 1 To 10 If f.Cells(1, m) <> "" Then liste = liste & f.Cells(1, m) & ";" End If Next m