Function CompterSamediUnique(Plage As Range, Optional annee)
Dim dico, xcell, t, i&, AN
Application.ScreenUpdating = False
AN = IIf(IsMissing(annee), "*", annee)
Set dico = CreateObject("scripting.dictionary")
t = Plage.Value
For i = 1 To UBound(t)
If t(i, 1) <> "" Then If IsDate(t(i, 1)) Then If Year(t(i, 1)) Like AN Then If Weekday(t(i, 1)) = 7 Then dico(CStr(t(i, 1))) = ""
Next i
CompterSamediUnique = dico.Count
End Function