Private Sub Worksheet_Activate()
Dim tablo, ncol%, d As Object, i&, j%, dat As Date, mois, item, x$
'---liste feuille Synthese---
tablo = Feuil55.[C40:X143] 'matrice, plus rapide, plage à adapter
ncol = UBound(tablo, 2)
Set d = CreateObject("Scripting.Dictionary")
For i = 1 To UBound(tablo)
For j = 12 To ncol
If IsDate(tablo(i, j)) Then
dat = DateSerial(Year(tablo(i, j)), Month(tablo(i, j)), 1)
d(dat & tablo(i, 1)) = tablo(i, j) 'mémorise la date
End If
Next j, i
'--tableau feuille compilation---
Application.ScreenUpdating = False
If FilterMode Then ShowAllData 'si la feuille est filtrée
With [G7:BE110] 'plage à adapter
.Value = "" 'RAZ
tablo = .Value 'matrice, plus rapide
ncol = UBound(tablo, 2)
mois = .Rows(-1) '2 lignes au-dessus
item = .Columns(-3) '4 colonnes à gauche
For i = 1 To UBound(tablo)
For j = 1 To ncol
If IsDate(mois(1, j)) Then
x = CDate(mois(1, j)) & item(i, 1)
If d.exists(x) Then tablo(i, j) = d(x)
End If
Next j, i
.Value = tablo 'restitution
End With
End Sub