1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Sub test1()
Dim Plage As Range, Tabl, C As Range, Ligne As Long, I As Long
Set Plage = Range("A1", Cells(Rows.Count, 1).End(xlUp))
Tabl = Application.Transpose(Range("B1", Cells(Rows.Count, 2).End(xlUp)))
[B:B].ClearContents
For Each C In Plage
If IsNumeric(Application.Match(C.Value, Tabl, 0)) Then
C.Offset(, 1).Value = C.Value
End If
Next C
Ligne = Plage.Rows.Count
For I = 1 To UBound(Tabl)
If Not IsNumeric(Application.Match(Tabl(I), Plage, 0)) Then
Ligne = Ligne + 1
Cells(Ligne, 1) = Tabl(I)
End If
Next I
Range("A1", Cells(Rows.Count, 1).End(xlUp)).Resize(, 2).Sort [A1], xlAscending
End Sub |
Partager