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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| Sub retenir()
Dim i, j, k, max, cle As Integer
i = 5
j = 5
k = 5
max = 0
cle = 0
For i = 5 To 261
For j = i + 1 To 261
cle = Range("A" & i).Value
max = Range("AF" & i).Value
If Range("A" & j).Value <> cle Then
Next j
Else
If Range("AF" & j).Value > max Then
max = Range("AF" & j).Value
Else: max = Range("AF" & i).Value
End If
End If
Next j
For k = i To 261
If Range("A" & k).Value <> "" Then Next k
Else
If Range("A" & k).Value = Range("A" & i).Value Then
Range("AG" & k).Value = max
Else
End If
End If
Next k
Next i
End Sub |
Partager