Suppression de doublon via 2 feuilles

Bonjour,

je cherche à supprimer les doublons de la feuille 1 (Colonne A et B, ligne 2) par rapport à la feuille 2 (Colonne A et B, ligne 2) puis copier les données de la feuille 2 à la suite de la feuille 1

Merci.

Bonjour,

P.

Voici le fichier.

re,

une manière de faire s(si ton fichier est structuré comme l'exemple)

P.

Bonsoir le fil,

Vois ceci :

Option Explicit
Sub test()
Dim a, b, i As Long, j As Long, txt As String, n As Long
    With Sheets("Feuil2").Cells(1).CurrentRegion
        b = .Offset(1).Resize(.Rows.Count - 1).Value
    End With
    With CreateObject("Scripting.Dictionary")
        .CompareMode = 1
        For i = 1 To UBound(b, 1)
            txt = Join(Array(b(i, 1), b(i, 2)), Chr(2))
            .Item(txt) = Empty
        Next
        a = Sheets("Feuil1").Cells(1).CurrentRegion.Value
        n = 1
        For i = 2 To UBound(a, 1)
            txt = Join(Array(a(i, 1), a(i, 2)), Chr(2))
            If Not .exists(txt) Then
                n = n + 1
                For j = 1 To UBound(a, 2)
                    a(n, j) = a(i, j)
                Next
            End If
        Next
    End With
    Application.ScreenUpdating = False
    With Sheets("Feuil1").Cells(1)
        .CurrentRegion.Clear
        .Resize(n, 2).FormulaLocal = a
        .Offset(n).Resize(UBound(b, 1), 2).FormulaLocal = b
        With .CurrentRegion
            .Font.Name = "calibri"
            .Font.Size = 10
            .VerticalAlignment = xlCenter
            .BorderAround Weight:=xlThin
            .Borders(xlInsideVertical).Weight = xlThin
            With .Rows(1)
                .BorderAround Weight:=xlThin
                .HorizontalAlignment = xlCenter
                .Interior.ColorIndex = 36
                .Font.Size = 11
            End With
            .Columns.ColumnWidth = 13
        End With
    End With
    Application.ScreenUpdating = True
End Sub

klin89

Merci Kling89 et patrick1957, vos méthodes fonctionnent nickel. Le détail que je n'avais pas précisé c'est que j'ai une colonne C.

Benoist28200 a écrit :

Merci Kling89 et patrick1957, vos méthodes fonctionnent nickel. Le détail que je n'avais pas précisé c'est que j'ai une colonne C.

Comme quoi il est mieux de mettre un BONNE copie anonymisée du fichier de travail...

oui désolé j'ai voulu aller trop vite

Rechercher des sujets similaires à "suppression doublon via feuilles"