Sub Manq()
Dim d As Object
Dim i&
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets(1)
Set d = CreateObject("scripting.dictionary")
With sh
For i = 2 To .Range("A" & .Cells.Rows.Count).End(xlUp).Row
d(.Cells(i, "B").Value) = ""
Next i
For i = 2 To .Range("A" & .Cells.Rows.Count).End(xlUp).Row
If Not d.exists(.Cells(i, "A").Value) Then .Cells(.Range("C" & .Cells.Rows.Count).End(xlUp).Row + 1, "C").Value = .Cells(i, "A").Value
Next i
End With
End Sub
Sub Manq()
Dim d As Object
Dim i&
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets(1)
Set d = CreateObject("scripting.dictionary")
With sh
For i = 2 To .Range("B1:B50" & .Cells.Rows.Count).End(xlUp).Row
Sheets("Feuil2").Select
d(.Cells(i, "A1:A50").Value) = ""
Next i
For i = 2 To .Range("A" & .Cells.Rows.Count).End(xlUp).Row
If Not d.exists(.Cells(i, "A").Value) Then .Cells(.Range("C" & .Cells.Rows.Count).End(xlUp).Row + 1, "C").Value = .Cells(i, "A").Value
Next i
End With
End Sub
Set sh = ThisWorkbook.Sheets(1)
.Range("C1:C" & .Range("C" & .Cells.Rows.Count).End(xlUp).Row).Offset(1).Clear
Sub Manq()
Dim d As Object
Dim i&
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets(2)
Set d = CreateObject("scripting.dictionary")
With sh
.Range("C1:C" & .Range("C" & .Cells.Rows.Count).End(xlUp).Row).Offset(1).Clear
For i = 2 To .Range("A" & .Cells.Rows.Count).End(xlUp).Row
d(.Cells(i, "B").Value) = ""
Next i
For i = 2 To .Range("A" & .Cells.Rows.Count).End(xlUp).Row
If Not d.exists(.Cells(i, "A").Value) Then .Cells(.Range("C" & .Cells.Rows.Count).End(xlUp).Row + 1, "C").Value = .Cells(i, "A").Value
Next i
End With
End Sub
Sub essai()
Dim colonne1 As Range, colonne2 As Range, cellule As Range, trouve As Range, suite As Range
'Compare la colonne A des feuilles 1 et 2
Set colonne1 = Sheets("feuil1").Range(("A20"), Sheets("feuil1").Range("A20").End(xlDown))
Set colonne2 = Sheets("feuil2").Range(("B10"), Sheets("feuil2").Range("B10").End(xlDown))
'Efface la plage de réception
Sheets("feuil2").Range("j1:j1000").ClearContents
'Retranscrit les données différente de la feuille1 sur la feuille2
For Each cellule In colonne1
Set suite = Sheets("feuil2").[J10].End(xlUp).Offset(1, 0)
Set trouve = colonne2.Find(cellule.Value, LookIn:=xlValues, lookat:=xlWhole)
If trouve Is Nothing Then suite.Value = cellule.Value
Next
End Sub