Module VBA a adapter

Bonjour les amis,

J'ai un souci d'adaptation de module, ça fait 3 semaines que j'essaye de comprendre et d'adapter mais pas facile. Quelqu'un pourrait-il m'aider svp ?

Je joins le fichier et une image pour expliquer tout cela.

Merci infiniment pour votre aide

capture

Je joins aussi le code.

Sub SupprimerLesDoublons()

    Set dicoC = CreateObject("Scripting.Dictionary")
    Set dicoE = CreateObject("Scripting.Dictionary")
    tabloC = Sheets("BaseComptable").Range("A4").CurrentRegion
    Set fE = Sheets("BaseEngagements")

    derCol = fE.Range("A2").CurrentRegion.Columns.Count + 4
    derLn = fE.Range("A2").CurrentRegion.Rows.Count
    If derLn = 1 Then Exit Sub
    tabloE = fE.Range("A2").Resize(derLn, derCol)
    fE.Range("A3").Resize(derLn - 1, derCol).Delete shift:=xlUp

    For i = 2 To UBound(tabloC, 1)
        dicoC(tabloC(i, 2) & tabloC(i, 4) & tabloC(i, 7)) = ""
    Next i

    k = 0
    For i = 2 To UBound(tabloE, 1)
        If Not dicoC.exists(tabloE(i, 1) & tabloE(i, 3) & tabloE(i, 6)) Then
            ReDim Preserve tabloR(1 To UBound(tabloE, 2), 1 To k + 1)
            For j = 1 To UBound(tabloE, 2)
                tabloR(j, k + 1) = tabloE(i, j)
            Next j
            k = k + 1
        End If
    Next i

    fE.Range("A3").Resize(UBound(tabloR, 2), derCol).Insert shift:=xlDown
    fE.Range("A3").Resize(UBound(tabloR, 2), UBound(tabloR, 1)) = Application.Transpose(tabloR)

    'Cosmétique
    With fE.Range("A3").Resize(UBound(tabloR, 2), UBound(tabloR, 1))
        .Interior.Color = xlNone
        .Font.ColorIndex = xlAutomatic
        .Font.Bold = False
        .Font.Size = 10
    End With

    With fE.Range("A3").Resize(UBound(tabloR, 2), 7)
            For i = 7 To 12
            .Borders(i).LineStyle = xlContinuous
        Next i
    End With

    With fE.Range("J3").Resize(UBound(tabloR, 2), 2)
        .Font.Size = 10
        For i = 7 To 12
            .Borders(i).LineStyle = xlContinuous
        Next i
    End With

    fE.Rows("3:" & UBound(tabloR, 2) + 1).RowHeight = 15.75

End Sub

Je ne suis pas le seul à plancher sur ce problème d'adaptation visiblement

Je confirme, ça doit être très compliqué à faire vu que personne à proposé une solution.

Je vais essayer autrement via des astuces d'excel...

Merci quand même

Rechercher des sujets similaires à "module vba adapter"