Sub Fusionner()
Dim d As Object, P1 As Range, P2 As Range, ncol1%, ncol2%, resu(), tablo, i&, x$, n&, j%, lig&
Set d = CreateObject("Scripting.Dictionary")
Set P1 = Sheets("1").[A1].CurrentRegion 'à adapter
Set P2 = Sheets("2").[A1].CurrentRegion 'à adapter
ncol1 = P1.Columns.Count
ncol2 = P2.Columns.Count - 1
ReDim resu(1 To P1.Rows.Count + P2.Rows.Count, 1 To ncol1 + ncol2)
tablo = P1.Resize(P1.Rows.Count + 1) 'matrice, plus rapide, au moins 2 éléments
For i = 1 To UBound(tablo) - 1
x = CStr(tablo(i, 1))
If Not d.exists(x) Then 'les doublons en colonne A sont ignorés, il ne doit donc pas y en avoir
n = n + 1
d(x) = n 'mémorise la ligne
For j = 1 To ncol1
If IsDate(tablo(i, j)) Then resu(n, j) = CDate(tablo(i, j)) Else resu(n, j) = tablo(i, j)
Next j
End If
Next i
tablo = P2.Resize(P2.Rows.Count + 1) 'matrice, plus rapide, au moins 2 éléments
For i = 1 To UBound(tablo) - 1
x = CStr(tablo(i, 1))
If Not d.exists(x) Then 'il ne doit pas y avoir de doublon en colonne A
n = n + 1
d(x) = n 'mémorise la ligne
resu(n, 1) = x
End If
lig = d(x)
For j = 1 To ncol2
If IsDate(tablo(i, j + 1)) Then resu(lig, j + ncol1) = CDate(tablo(i, j + 1)) Else resu(lig, j + ncol1) = tablo(i, j + 1)
Next j, i
'---restitution et mise en forme---
Application.ScreenUpdating = False
With Sheets("Fusion") 'à adapter
If .FilterMode Then .ShowAllData 'si la feuille est filtrée
.Cells.ClearContents 'RAZ
.Cells.Borders.LineStyle = xlNone 'RAZ
.Columns.ColumnWidth = .Columns(.Columns.Count).ColumnWidth 'RAZ
.[A1].Resize(n, ncol1 + ncol2) = resu
.[A1].CurrentRegion.Borders.Weight = xlThin 'bordures
.Columns.AutoFit 'ajustement largeurs
With .UsedRange: End With 'actualise les barres de défilement
.Activate 'facultatif
End With
End Sub