Function NbDossier(debut As Range, crit1$, col1, crit2$, col2, coldossier)
Dim P As Range, d As Object, i&
If crit1 Like "<*>" Then crit1 = "*" 'caractère générique *
If crit2 Like "<*>" Then crit2 = "*"
crit1 = UCase(crit1): crit2 = UCase(crit2) 'majuscules
Set P = debut.Parent.Range("A1", debut.Parent.UsedRange)
col1 = Intersect(col1, P) 'matrice, plus rapide
col2 = Intersect(col2, P)
coldossier = Intersect(coldossier, P)
Set d = CreateObject("Scripting.Dictionary")
d.compareMode = vbTextCompare 'la casse est ignorée
For i = debut.Row + 1 To UBound(col1)
If UCase(col1(i, 1)) Like crit1 And UCase(col2(i, 1)) Like crit2 And coldossier(i, 1) <> "" Then d(coldossier(i, 1)) = ""
Next
NbDossier = d.Count
End Function