1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| With Sheets("extraction")
Range("A2:F65000").Select
Selection.Sort Key1:=Range("C2"), Order1:=xlAscending, Key1:=Range("D2"), Order1:=xlAscending, Header:=xlGuess
LastRow = .Cells(.Rows.Count, 3).End(xlUp).Row
For i = LastRow To 2 Step -1
If .Cells(i, 3).Value = .Cells(i - 1, 3).Value And .Cells(i, 4).Value = .Cells(i - 1, 74).Value Then
t = .Cells(i - 1, 5).Value + .Cells(i, 5).Value
.Cells(i - 1, 6).Value = t / 2
.Cells(i, 6).Value = t / 2
End If
Next j
Next i
End With |
Partager