Option Explicit
Const Vcol As Long = 5 'Vérifie 5 premieres colonnes
Sub Itemsdifferents()
Application.ScreenUpdating = False
Dim RngA As Range, RngB As Range, Cll As Range
Dim K&, Ka&, Kb&, Kf&, Rw&, Cola&, Colb&, Limita&
Dim Tablo(), Tabuniq As Variant, Vardatas As Variant
Ka = Feuil1.Cells(65536, 1).End(xlUp).Row
Kb = Feuil2.Cells(65536, 1).End(xlUp).Row
Cola = 1: Colb = 1
Feuil3.Cells.ClearContents
Set RngA = Feuil1.Range("A2").Resize(Ka, 1)
Set RngB = Feuil2.Range("A2").Resize(Kb, 1)
ReDim Tablo(1 To Ka + Kb, 1)
Rw = 1
For Each Cll In RngB
If Application.CountIf(RngA, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Limita = Rw - 1
Rw = Rw - 1
For Each Cll In RngA
If Application.CountIf(RngB, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Feuil3.Cells(1, 1) = Feuil1.Cells(1, 1)
For Rw = LBound(Tablo) To Limita
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Tabuniq = Feuil3.Cells(1, Cola).Resize(Limita, Cola).Value
Vardatas = Feuil2.Cells(1, Colb).Resize(Kb, Vcol).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Vardatas
Erase Tabuniq
For Rw = Limita + 1 To UBound(Tablo)
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Vardatas = Feuil1.Cells(1, Cola).Resize(Ka, Vcol).Value
Tabuniq = Feuil3.Cells(Limita + 1, Cola).Resize(Rw, Cola).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf + Limita, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf + Limita, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf + Limita, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf + Limita, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Tablo: Erase Vardatas: Erase Tabuniq
Set RngA = Nothing: Set RngB = Nothing
End Sub
Option Explicit
Const Vcol As Long = 5 'Vérifie 5 premieres colonnes
Sub Itemsdifferents()
Application.ScreenUpdating = False
Dim RngA As Range, RngB As Range, Cll As Range
Dim K&, Ka&, Kb&, Kf&, Rw&, Cola&, Colb&, Limita&
Dim Tablo(), Tabuniq As Variant, Vardatas As Variant
Ka = Feuil1.Cells(65536, 1).End(xlUp).Row
Kb = Feuil2.Cells(65536, 1).End(xlUp).Row
Cola = 1: Colb = 1
Feuil3.Cells.ClearContents
Set RngA = Feuil1.Range("A2").Resize(Ka, 1)
Set RngB = Feuil2.Range("A2").Resize(Kb, 1)
ReDim Tablo(1 To Ka + Kb, 1)
Rw = 1
For Each Cll In RngB
If Application.CountIf(RngA, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Limita = Rw - 1
Rw = Rw - 1
For Each Cll In RngA
If Application.CountIf(RngB, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Feuil3.Cells(1, 1) = Feuil1.Cells(1, 1)
For Rw = LBound(Tablo) To Limita
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Tabuniq = Feuil3.Cells(1, Cola).Resize(Limita, Cola).Value
Vardatas = Feuil2.Cells(1, Colb).Resize(Kb, Vcol).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Vardatas
Erase Tabuniq
For Rw = Limita + 1 To UBound(Tablo)
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Vardatas = Feuil1.Cells(1, Cola).Resize(Ka, Vcol).Value
Tabuniq = Feuil3.Cells(Limita + 1, Cola).Resize(Rw, Cola).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf + Limita, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf + Limita, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf + Limita, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf + Limita, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Tablo: Erase Vardatas: Erase Tabuniq
Set RngA = Nothing: Set RngB = Nothing
End Sub
Option Explicit
Const Vcol As Long = 5 'Vérifie 5 premieres colonnes
Sub Itemsdifferents()
Application.ScreenUpdating = False
Dim RngA As Range, RngB As Range, Cll As Range
Dim K&, Ka&, Kb&, Kf&, Rw&, Cola&, Colb&, Limita&
Dim Tablo(), Tabuniq As Variant, Vardatas As Variant
Ka = Feuil1.Cells(65536, 1).End(xlUp).Row
Kb = Feuil2.Cells(65536, 1).End(xlUp).Row
Cola = 1: Colb = 1
Feuil3.Cells.ClearContents
Set RngA = Feuil1.Range("A2").Resize(Ka, 1)
Set RngB = Feuil2.Range("A2").Resize(Kb, 1)
ReDim Tablo(1 To Ka + Kb, 1)
Rw = 1
For Each Cll In RngB
If Application.CountIf(RngA, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Limita = Rw - 1
Rw = Rw - 1
For Each Cll In RngA
If Application.CountIf(RngB, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Feuil3.Cells(1, 1) = Feuil1.Cells(1, 1)
For Rw = LBound(Tablo) To Limita
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Tabuniq = Feuil3.Cells(1, Cola).Resize(Limita, Cola).Value
Vardatas = Feuil2.Cells(1, Colb).Resize(Kb, Vcol).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Vardatas
Erase Tabuniq
For Rw = Limita + 1 To UBound(Tablo)
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Vardatas = Feuil1.Cells(1, Cola).Resize(Ka, Vcol).Value
Tabuniq = Feuil3.Cells(Limita + 1, Cola).Resize(Rw, Cola).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf + Limita, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf + Limita, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf + Limita, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf + Limita, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Tablo: Erase Vardatas: Erase Tabuniq
Set RngA = Nothing: Set RngB = Nothing
End Sub
Option Explicit
Const Vcol As Long = 5 'Vérifie 5 premieres colonnes
Sub Itemsdifferents()
Application.ScreenUpdating = False
Dim RngA As Range, RngB As Range, Cll As Range
Dim K&, Ka&, Kb&, Kf&, Rw&, Cola&, Colb&, Limita&
Dim Tablo(), Tabuniq As Variant, Vardatas As Variant
Ka = Feuil1.Cells(65536, 1).End(xlUp).Row
Kb = Feuil2.Cells(65536, 1).End(xlUp).Row
Cola = 1: Colb = 1
Feuil3.Cells.ClearContents
Set RngA = Feuil1.Range("A2").Resize(Ka, 1)
Set RngB = Feuil2.Range("A2").Resize(Kb, 1)
ReDim Tablo(1 To Ka + Kb, 1)
Rw = 1
For Each Cll In RngB
If Application.CountIf(RngA, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Limita = Rw - 1
Rw = Rw - 1
For Each Cll In RngA
If Application.CountIf(RngB, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Feuil3.Cells(1, 1) = Feuil1.Cells(1, 1)
For Rw = LBound(Tablo) To Limita
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Tabuniq = Feuil3.Cells(1, Cola).Resize(Limita, Cola).Value
Vardatas = Feuil2.Cells(1, Colb).Resize(Kb, Vcol).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Vardatas
Erase Tabuniq
For Rw = Limita + 1 To UBound(Tablo)
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Vardatas = Feuil1.Cells(1, Cola).Resize(Ka, Vcol).Value
Tabuniq = Feuil3.Cells(Limita + 1, Cola).Resize(Rw, Cola).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf + Limita, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf + Limita, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf + Limita, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf + Limita, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Tablo: Erase Vardatas: Erase Tabuniq
Set RngA = Nothing: Set RngB = Nothing
End Sub
Option Explicit
Const Vcol As Long = 5 'Vérifie 5 premieres colonnes
Sub Itemsdifferents()
Application.ScreenUpdating = False
Dim RngA As Range, RngB As Range, Cll As Range
Dim K&, Ka&, Kb&, Kf&, Rw&, Cola&, Colb&, Limita&
Dim Tablo(), Tabuniq As Variant, Vardatas As Variant
Ka = Feuil1.Cells(65536, 1).End(xlUp).Row
Kb = Feuil2.Cells(65536, 1).End(xlUp).Row
Cola = 1: Colb = 1
Feuil3.Cells.ClearContents
Set RngA = Feuil1.Range("A2").Resize(Ka, 1)
Set RngB = Feuil2.Range("A2").Resize(Kb, 1)
ReDim Tablo(1 To Ka + Kb, 1)
Rw = 1
For Each Cll In RngB
If Application.CountIf(RngA, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Limita = Rw - 1
Rw = Rw - 1
For Each Cll In RngA
If Application.CountIf(RngB, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Feuil3.Cells(1, 1) = Feuil1.Cells(1, 1)
For Rw = LBound(Tablo) To Limita
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Tabuniq = Feuil3.Cells(1, Cola).Resize(Limita, Cola).Value
Vardatas = Feuil2.Cells(1, Colb).Resize(Kb, Vcol).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Vardatas
Erase Tabuniq
For Rw = Limita + 1 To UBound(Tablo)
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Vardatas = Feuil1.Cells(1, Cola).Resize(Ka, Vcol).Value
Tabuniq = Feuil3.Cells(Limita + 1, Cola).Resize(Rw, Cola).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf + Limita, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf + Limita, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf + Limita, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf + Limita, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Tablo: Erase Vardatas: Erase Tabuniq
Set RngA = Nothing: Set RngB = Nothing
End Sub
Option Explicit
Const Vcol As Long = 5 'Vérifie 5 premieres colonnes
Sub Itemsdifferents()
Application.ScreenUpdating = False
Dim RngA As Range, RngB As Range, Cll As Range
Dim K&, Ka&, Kb&, Kf&, Rw&, Cola&, Colb&, Limita&
Dim Tablo(), Tabuniq As Variant, Vardatas As Variant
Ka = Feuil1.Cells(65536, 1).End(xlUp).Row
Kb = Feuil2.Cells(65536, 1).End(xlUp).Row
Cola = 1: Colb = 1
Feuil3.Cells.ClearContents
Set RngA = Feuil1.Range("A2").Resize(Ka, 1)
Set RngB = Feuil2.Range("A2").Resize(Kb, 1)
ReDim Tablo(1 To Ka + Kb, 1)
Rw = 1
For Each Cll In RngB
If Application.CountIf(RngA, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Limita = Rw - 1
Rw = Rw - 1
For Each Cll In RngA
If Application.CountIf(RngB, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Feuil3.Cells(1, 1) = Feuil1.Cells(1, 1)
For Rw = LBound(Tablo) To Limita
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Tabuniq = Feuil3.Cells(1, Cola).Resize(Limita, Cola).Value
Vardatas = Feuil2.Cells(1, Colb).Resize(Kb, Vcol).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Vardatas
Erase Tabuniq
For Rw = Limita + 1 To UBound(Tablo)
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Vardatas = Feuil1.Cells(1, Cola).Resize(Ka, Vcol).Value
Tabuniq = Feuil3.Cells(Limita + 1, Cola).Resize(Rw, Cola).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf + Limita, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf + Limita, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf + Limita, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf + Limita, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Tablo: Erase Vardatas: Erase Tabuniq
Set RngA = Nothing: Set RngB = Nothing
End Sub
Option Explicit
Const Vcol As Long = 5 'Vérifie 5 premieres colonnes
Sub Itemsdifferents()
Application.ScreenUpdating = False
Dim RngA As Range, RngB As Range, Cll As Range
Dim K&, Ka&, Kb&, Kf&, Rw&, Cola&, Colb&, Limita&
Dim Tablo(), Tabuniq As Variant, Vardatas As Variant
Ka = Feuil1.Cells(65536, 1).End(xlUp).Row
Kb = Feuil2.Cells(65536, 1).End(xlUp).Row
Cola = 1: Colb = 1
Feuil3.Cells.ClearContents
Set RngA = Feuil1.Range("A2").Resize(Ka, 1)
Set RngB = Feuil2.Range("A2").Resize(Kb, 1)
ReDim Tablo(1 To Ka + Kb, 1)
Rw = 1
For Each Cll In RngB
If Application.CountIf(RngA, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Limita = Rw - 1
Rw = Rw - 1
For Each Cll In RngA
If Application.CountIf(RngB, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Feuil3.Cells(1, 1) = Feuil1.Cells(1, 1)
For Rw = LBound(Tablo) To Limita
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Tabuniq = Feuil3.Cells(1, Cola).Resize(Limita, Cola).Value
Vardatas = Feuil2.Cells(1, Colb).Resize(Kb, Vcol).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Vardatas
Erase Tabuniq
For Rw = Limita + 1 To UBound(Tablo)
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Vardatas = Feuil1.Cells(1, Cola).Resize(Ka, Vcol).Value
Tabuniq = Feuil3.Cells(Limita + 1, Cola).Resize(Rw, Cola).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf + Limita, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf + Limita, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf + Limita, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf + Limita, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Tablo: Erase Vardatas: Erase Tabuniq
Set RngA = Nothing: Set RngB = Nothing
End Sub
Option Explicit
Const Vcol As Long = 5 'Vérifie 5 premieres colonnes
Sub Itemsdifferents()
Application.ScreenUpdating = False
Dim RngA As Range, RngB As Range, Cll As Range
Dim K&, Ka&, Kb&, Kf&, Rw&, Cola&, Colb&, Limita&
Dim Tablo(), Tabuniq As Variant, Vardatas As Variant
Ka = Feuil1.Cells(65536, 1).End(xlUp).Row
Kb = Feuil2.Cells(65536, 1).End(xlUp).Row
Cola = 1: Colb = 1
Feuil3.Cells.ClearContents
Set RngA = Feuil1.Range("A2").Resize(Ka, 1)
Set RngB = Feuil2.Range("A2").Resize(Kb, 1)
ReDim Tablo(1 To Ka + Kb, 1)
Rw = 1
For Each Cll In RngB
If Application.CountIf(RngA, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Limita = Rw - 1
Rw = Rw - 1
For Each Cll In RngA
If Application.CountIf(RngB, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Feuil3.Cells(1, 1) = Feuil1.Cells(1, 1)
For Rw = LBound(Tablo) To Limita
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Tabuniq = Feuil3.Cells(1, Cola).Resize(Limita, Cola).Value
Vardatas = Feuil2.Cells(1, Colb).Resize(Kb, Vcol).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Vardatas
Erase Tabuniq
For Rw = Limita + 1 To UBound(Tablo)
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Vardatas = Feuil1.Cells(1, Cola).Resize(Ka, Vcol).Value
Tabuniq = Feuil3.Cells(Limita + 1, Cola).Resize(Rw, Cola).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf + Limita, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf + Limita, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf + Limita, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf + Limita, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Tablo: Erase Vardatas: Erase Tabuniq
Set RngA = Nothing: Set RngB = Nothing
End Sub
Option Explicit
Const Vcol As Long = 5 'Vérifie 5 premieres colonnes
Sub Itemsdifferents()
Application.ScreenUpdating = False
Dim RngA As Range, RngB As Range, Cll As Range
Dim K&, Ka&, Kb&, Kf&, Rw&, Cola&, Colb&, Limita&
Dim Tablo(), Tabuniq As Variant, Vardatas As Variant
Ka = Feuil1.Cells(65536, 1).End(xlUp).Row
Kb = Feuil2.Cells(65536, 1).End(xlUp).Row
Cola = 1: Colb = 1
Feuil3.Cells.ClearContents
Set RngA = Feuil1.Range("A2").Resize(Ka, 1)
Set RngB = Feuil2.Range("A2").Resize(Kb, 1)
ReDim Tablo(1 To Ka + Kb, 1)
Rw = 1
For Each Cll In RngB
If Application.CountIf(RngA, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Limita = Rw - 1
Rw = Rw - 1
For Each Cll In RngA
If Application.CountIf(RngB, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Feuil3.Cells(1, 1) = Feuil1.Cells(1, 1)
For Rw = LBound(Tablo) To Limita
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Tabuniq = Feuil3.Cells(1, Cola).Resize(Limita, Cola).Value
Vardatas = Feuil2.Cells(1, Colb).Resize(Kb, Vcol).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Vardatas
Erase Tabuniq
For Rw = Limita + 1 To UBound(Tablo)
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Vardatas = Feuil1.Cells(1, Cola).Resize(Ka, Vcol).Value
Tabuniq = Feuil3.Cells(Limita + 1, Cola).Resize(Rw, Cola).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf + Limita, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf + Limita, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf + Limita, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf + Limita, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Tablo: Erase Vardatas: Erase Tabuniq
Set RngA = Nothing: Set RngB = Nothing
End Sub
désolé.... j ai compris le prob... tout marche super bien... un gros merci
starwing
"Starwing" a écrit :Option Explicit
Const Vcol As Long = 5 'Vérifie 5 premieres colonnes
Sub Itemsdifferents()
Application.ScreenUpdating = False
Dim RngA As Range, RngB As Range, Cll As Range
Dim K&, Ka&, Kb&, Kf&, Rw&, Cola&, Colb&, Limita&
Dim Tablo(), Tabuniq As Variant, Vardatas As Variant
Ka = Feuil1.Cells(65536, 1).End(xlUp).Row
Kb = Feuil2.Cells(65536, 1).End(xlUp).Row
Cola = 1: Colb = 1
Feuil3.Cells.ClearContents
Set RngA = Feuil1.Range("A2").Resize(Ka, 1)
Set RngB = Feuil2.Range("A2").Resize(Kb, 1)
ReDim Tablo(1 To Ka + Kb, 1)
Rw = 1
For Each Cll In RngB
If Application.CountIf(RngA, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Limita = Rw - 1
Rw = Rw - 1
For Each Cll In RngA
If Application.CountIf(RngB, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Feuil3.Cells(1, 1) = Feuil1.Cells(1, 1)
For Rw = LBound(Tablo) To Limita
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Tabuniq = Feuil3.Cells(1, Cola).Resize(Limita, Cola).Value
Vardatas = Feuil2.Cells(1, Colb).Resize(Kb, Vcol).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Vardatas
Erase Tabuniq
For Rw = Limita + 1 To UBound(Tablo)
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Vardatas = Feuil1.Cells(1, Cola).Resize(Ka, Vcol).Value
Tabuniq = Feuil3.Cells(Limita + 1, Cola).Resize(Rw, Cola).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf + Limita, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf + Limita, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf + Limita, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf + Limita, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Tablo: Erase Vardatas: Erase Tabuniq
Set RngA = Nothing: Set RngB = Nothing
End Sub
désolé.... j ai compris le prob... tout marche super bien... un gros merci
starwing
"Starwing" a écrit :
Option Explicit
Const Vcol As Long = 5 'Vérifie 5 premieres colonnes
Sub Itemsdifferents()
Application.ScreenUpdating = False
Dim RngA As Range, RngB As Range, Cll As Range
Dim K&, Ka&, Kb&, Kf&, Rw&, Cola&, Colb&, Limita&
Dim Tablo(), Tabuniq As Variant, Vardatas As Variant
Ka = Feuil1.Cells(65536, 1).End(xlUp).Row
Kb = Feuil2.Cells(65536, 1).End(xlUp).Row
Cola = 1: Colb = 1
Feuil3.Cells.ClearContents
Set RngA = Feuil1.Range("A2").Resize(Ka, 1)
Set RngB = Feuil2.Range("A2").Resize(Kb, 1)
ReDim Tablo(1 To Ka + Kb, 1)
Rw = 1
For Each Cll In RngB
If Application.CountIf(RngA, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Limita = Rw - 1
Rw = Rw - 1
For Each Cll In RngA
If Application.CountIf(RngB, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Feuil3.Cells(1, 1) = Feuil1.Cells(1, 1)
For Rw = LBound(Tablo) To Limita
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Tabuniq = Feuil3.Cells(1, Cola).Resize(Limita, Cola).Value
Vardatas = Feuil2.Cells(1, Colb).Resize(Kb, Vcol).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Vardatas
Erase Tabuniq
For Rw = Limita + 1 To UBound(Tablo)
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Vardatas = Feuil1.Cells(1, Cola).Resize(Ka, Vcol).Value
Tabuniq = Feuil3.Cells(Limita + 1, Cola).Resize(Rw, Cola).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf + Limita, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf + Limita, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf + Limita, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf + Limita, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Tablo: Erase Vardatas: Erase Tabuniq
Set RngA = Nothing: Set RngB = Nothing
End Sub
désolé.... j ai compris le prob... tout marche super bien... un gros merci
starwing
"Starwing" a écrit :Option Explicit
Const Vcol As Long = 5 'Vérifie 5 premieres colonnes
Sub Itemsdifferents()
Application.ScreenUpdating = False
Dim RngA As Range, RngB As Range, Cll As Range
Dim K&, Ka&, Kb&, Kf&, Rw&, Cola&, Colb&, Limita&
Dim Tablo(), Tabuniq As Variant, Vardatas As Variant
Ka = Feuil1.Cells(65536, 1).End(xlUp).Row
Kb = Feuil2.Cells(65536, 1).End(xlUp).Row
Cola = 1: Colb = 1
Feuil3.Cells.ClearContents
Set RngA = Feuil1.Range("A2").Resize(Ka, 1)
Set RngB = Feuil2.Range("A2").Resize(Kb, 1)
ReDim Tablo(1 To Ka + Kb, 1)
Rw = 1
For Each Cll In RngB
If Application.CountIf(RngA, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Limita = Rw - 1
Rw = Rw - 1
For Each Cll In RngA
If Application.CountIf(RngB, Cll.Value) = 0 Then
Tablo(Rw, 1) = Cll.Value
Rw = Rw + 1
End If
Next
Feuil3.Cells(1, 1) = Feuil1.Cells(1, 1)
For Rw = LBound(Tablo) To Limita
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Tabuniq = Feuil3.Cells(1, Cola).Resize(Limita, Cola).Value
Vardatas = Feuil2.Cells(1, Colb).Resize(Kb, Vcol).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Vardatas
Erase Tabuniq
For Rw = Limita + 1 To UBound(Tablo)
Feuil3.Cells(Rw + 1, Cola) = Tablo(Rw, 1)
Next
Vardatas = Feuil1.Cells(1, Cola).Resize(Ka, Vcol).Value
Tabuniq = Feuil3.Cells(Limita + 1, Cola).Resize(Rw, Cola).Value
For K = LBound(Vardatas) To UBound(Vardatas)
For Kf = LBound(Tabuniq, 1) To UBound(Tabuniq, 1)
If Vardatas(K, 1) = Tabuniq(Kf, 1) Then
Feuil3.Cells(Kf + Limita, 2) = Vardatas(K, 2)
Feuil3.Cells(Kf + Limita, 3) = Vardatas(K, 3)
Feuil3.Cells(Kf + Limita, 4) = Vardatas(K, 4)
Feuil3.Cells(Kf + Limita, Vcol) = Vardatas(K, Vcol)
End If
Next Kf
Next K
Erase Tablo: Erase Vardatas: Erase Tabuniq
Set RngA = Nothing: Set RngB = Nothing
End Sub