1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| Sub Recup_Valeurs()
Dim f1 As Worksheet, f2 As Worksheet
Dim DerLig_f1 As Long, DerLig_f2 As Long
Dim i As Long, j As Long
Application.ScreenUpdating = False
Set f1 = Sheets("Feuil1")
Set f2 = Sheets("Feuil2")
DerLig_f1 = f1.[A10000].End(xlUp).Row
DerLig_f2 = f2.[A10000].End(xlUp).Row
For i = 2 To DerLig_f1
Result = ""
Set x = f2.Rows(1).Find(f1.Cells(i, "A"), LookIn:=xlValues, lookat:=xlWhole)
For j = 2 To DerLig_f2
If f2.Cells(j, x.Column) = 1 Then Result = Result & " " & f2.Cells(j, "A")
Next j
f1.Cells(i, "B") = Result
Next i
End Sub |
Partager