Private Sub Worksheet_Change(ByVal Target As Range)
Dim dest As Range, d As Object, tablo, ub&, j%, i&, x$, a, b, c()
Set dest = [J3] '1ère cellule de destination, à adapter
Set d = CreateObject("Scripting.Dictionary")
d.CompareMode = vbTextCompare 'la casse est ignorée
tablo = Range("A3:H" & Cells.SpecialCells(xlCellTypeLastCell).Row).Value2 'matrice, plus rapide
ub = UBound(tablo)
For j = 1 To UBound(tablo, 2) Step 2
For i = 1 To ub
x = Trim(CStr(tablo(i, j)))
If x <> "" Then If Not d.exists(x) Then d(x) = tablo(i, j + 1) 'mémorise la date dans les items
Next i, j
Application.ScreenUpdating = False
Application.EnableEvents = False 'désactive les évènements
If d.Count Then
a = d.keys: b = d.items
ReDim c(UBound(a), 2) 'base 0
For i = 0 To UBound(a): c(i, 0) = a(i): c(i, 2) = b(i): Next 'transposition
With dest.Resize(d.Count, 3)
.Value = c 'restitution
.Columns(1).Interior.Color = RGB(255, 255, 204) 'jaune clair
.Columns(3).NumberFormat = "dd mmmm yyyy" 'format date
.Sort .Columns(3), xlAscending, Header:=xlNo 'tri sur les dates
End With
End If
dest.Offset(d.Count).Resize(Rows.Count - d.Count - dest.Row + 1, 3).Clear 'RAZ en dessous
Application.EnableEvents = True 'réactive les évènements
With UsedRange: End With 'actualise la barre de défilement verticale
End Sub