Function compte(r As Range, s$, Optional tf As Boolean = True)
Application.Volatile 'selon le besoin…
Dim tmp&, oCel As Range
For Each oCel In r
If oCel.Text <> "RH" And oCel.Text <> "F" Then
tmp = (Not IsEmpty(oCel)) * (tmp + 1) * ((oCel.Text = s) = tf)
compte = compte - (tmp > compte)
End If
Next
End Function