1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Sub toto()
Dim i As Long, j As Long, k As Long
k = 2
With Sheets("Feuil2")
For i = 2 To .Range("A" & .Rows.Count).End(xlUp).Row
Feuil3.Cells(k, 1) = .Cells(i, 1)
Feuil3.Cells(k, 2) = .Cells(i, 2)
Feuil3.Cells(k, 3) = .Cells(i, 3)
Feuil3.Cells(k, 4) = .Cells(i, 4)
For j = 2 To .Range("A" & .Rows.Count).End(xlUp).Row
If .Cells(i, 1) = .Cells(j, 5) Then
Feuil3.Cells(k, 5) = .Cells(i, 5)
Feuil3.Cells(k, 6) = .Cells(i, 6)
Feuil3.Cells(k, 7) = .Cells(i, 7)
bool = True
End If
Next j
k = k + 1
Next i
End With
End Sub |
Partager