Function MaSomme#(plage As Range, colNom%, colDate%, colSomme%, Optional dat1 As Date, Optional dat2 As Date)
Dim d As Object, tablo, i&, dat, test As Boolean
Set d = CreateObject("Scripting.Dictionary")
d.CompareMode = vbTextCompare 'la casse est ignorée
tablo = plage 'matrice, plus rapide
For i = 1 To UBound(tablo)
dat = tablo(i, colDate)
test = IIf(dat1 And dat2, dat >= dat1 And dat <= dat2, True)
If IsDate(tablo(i, colDate)) Then If test Then...