1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
Sub Bouton4_Cliquer()
Dim Ligne As Long, Lig As Long, Res As Double
Ligne = 50
For i = 51 To Cells(Rows.Count, 13).End(xlUp).Row
If Cells(i, 13) > 0.01 Then
Res = 0
Do Until Cells(i, 13) < 0.01
If Cells(i, 13) > Cells(i - 1, 13) And Cells(i, 13) > Cells(i + 1, 13) Then
Lig = Cells(i, 13).Row
Ligne = Ligne + 1
Cells(Ligne, 16).Resize(, 13).Value = Cells(Lig, 1).Resize(, 13).Value
Else
Res = Application.WorksheetFunction.Large(Columns(13), 4)
Lig = Cells(i, 13).Row
Ligne = Ligne + 1
Cells(Ligne, 16).Resize(, 13).Value = Cells(Lig, 1).Resize(, 13).Value
End If
'on incrémente i
i = i + 1
Loop
End If
Next i
End Sub |