1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Sub Recup_Noms_Gsm()
Dim i As Long, j As Long
Dim n As Object
Application.ScreenUpdating = False
Range("D2:D10000").ClearContents
Lig = 2 'Première ligne libre de la colonne D
For i = 1 To 2 'de la colonne A à B
DerLig = Cells(Rows.Count, i).End(xlUp).Row
For j = 2 To DerLig 'de la ligne 2 jusqu'à la dernière
Nom = Cells(j, i)
Set n = Columns("H").Find(Nom, LookIn:=xlValues, lookat:=xlWhole)
If Not n Is Nothing Then
Cells(Lig, "D") = Nom
Cells(Lig + 1, "D") = Cells(n.Row + 1, "H")
Lig = Lig + 2
End If
Next j
Next i
Set n = Nothing
End Sub |
Partager