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
| Sub MacroAnalysedata()
ActiveSheet.Range("$A$6:$Z$406").AutoFilter Field:=2
Dim DernLigne As Long
Dim l As Long
For i = 3 To 26
l = 0
For j = 9 To 406 Step 5
If Cells(j, i) = "" Then
Exit For
Else
For k = 8 To 87
If Cells(j, i) = Cells(k, 30) Then
Cells(k, i + 29).Formula = Cells(k, (i + 29)).Value + Cells((j + 2), i).Value
l = 1
Exit For
End If
Next k
If l = 0 Then
DernLigne = Range("AD" & Rows.Count).End(xlUp).Row + 1
Cells(DernLigne, 30) = Cells(j, i)
Cells(DernLigne, 29) = Cells(j - 1, i)
Cells(DernLigne, 31) = Cells(j + 1, i)
Cells(DernLigne, (i + 29)) = Cells((j + 2), i)
End If
End If
Next j
Next i
End Sub |
Partager