Dim min As Long, liste As String, toto liste = "3;4;10;2;7" toto = Split(liste, ";") min = Val(toto(0)) For i = 1 To UBound(toto) If Val(toto(i)) < min Then min = Val(toto(i)) Next MsgBox min
Dim min As Single, liste As String, toto liste = "3,4;4;10;2,1;7" toto = Split(liste, ";") min = CSng(toto(0)) For i = 1 To UBound(toto) If CSng(toto(i)) < min Then min = CSng(toto(i)) Next MsgBox min
Dim min As Single, R As Range For i = 1 To 10 If Cells(1, i) <> "" Then If R Is Nothing Then Set R Cells(1, i) Else Set R Union(R, Cells(1, i)) End If Next min = WorksheetFunction.min(R) Set R = Nothing MsgBox min
Sub min_max() Dim mini1 As Single, maxi1 As Single, R As Range For j = 60 To 66 Set R = Nothing For i = 3 To 93 If Cells(j, i) <> "" Then If R Is Nothing Then Set R Cells(j, i) Else Set R Union(R, Cells(j, i)) mini1 = WorksheetFunction.min(R) maxi1 = WorksheetFunction.Max(R) End If Next mini2 = mini1 maxi2 = maxi1 Cells(j + 13, 7) = mini2 Cells(j + 13, 9) = maxi2 Next j End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDim min As Single, R As Range, monrange As Range, c As Range Set monrange = Range("A1:C10") For Each c In monrange.Cells If c.Value <> "" Then If R Is Nothing Then Set R c Else Set R Union(R, c) End If Next min = WorksheetFunction.min(R) Set R Nothing: Set monrange Nothing: Set c = Nothing MsgBox min
Dim min As Single, R As Range, monrange As Range, c As Range, ligne As Range Set monrange = Range("A1:C10") For Each ligne In monrange.Rows Set R = Nothing For Each c In ligne.Cells If c.Value <> "" Then If R Is Nothing Then Set R c Else Set R Union(R, c) End If Next If Not R Is Nothing Then MsgBox "minimum en ligne " & ligne.Row & " ==>> " & WorksheetFunction.min(R) Else MsgBox "bernique (que dalle) en ligne : " & ligne.Row End If Next Set R Nothing: Set monrange Nothing: Set c = Nothing