Function NbUnique&(matricule As Range, metier As Range, LogTime As Range, dat1&, dat2&, metierRef$)
Dim d As Object, i&
Set d = CreateObject("Scripting.Dictionary")
i = 2
Do While matricule(i) <> ""
If metier(i) = metierRef And LogTime(i) >= dat1 And LogTime(i) <= dat2 _
And Not d.exists(matricule(i).Value) Then d(matricule(i).Value) = ""
i = i + 1
Loop
NbUnique = d.Count
End Function
Function NbNouveau&(matricule As Range, metier As Range, LogTime As Range, dat1&, dat2&, metierRef$, datprec1&, datprec2&)
Dim d As Object, i&
Set d = CreateObject("Scripting.Dictionary")
i = 2
Do While matricule(i) <> ""
If metier(i) = metierRef And LogTime(i) >= dat1 And LogTime(i) <= dat2 _
And Not d.exists(matricule(i).Value) Then d(matricule(i).Value) = ""
i = i + 1
Loop
If d.Count = 0 Then Exit Function
i = 2
Do While matricule(i) <> ""
If metier(i) = metierRef And LogTime(i) >= datprec1 And LogTime(i) <= datprec2 _
And d.exists(matricule(i).Value) Then d.Remove matricule(i).Value
i = i + 1
Loop
NbNouveau = d.Count
End Function