1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| Sub Test()
Dim FL1 As Worksheet, FL2 As Worksheet, Cell As Range, c as range
Set FL1 = Worksheets("feuil1")
Set FL2 = Worksheets("feuil2")
For Each Cell In FL1.Range("a1:a" & Cells(Columns(NoCol).Cells.Count, NoCol).End(xlUp).Row)
With FL2.Range("a1:a" & FL2.Range("a1:a" & Cells(Columns(NoCol).Cells.Count, NoCol).End(xlUp).Row))
Set c = .Find(Cell, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
Cell.Offset(0, 1) = c.Offset(0, 1)
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
Next
End Sub |
Partager