[B][COLOR="DarkSlateGray"]Function compteMot9(plg As Range, mot As String, ParamArray clefs()) As Integer
[COLOR="SeaGreen"]' 5 Nivôse CCXVIII - Roger fecit.[/COLOR]
Application.Volatile
Dim ar As Range, cl As Range, txt As String, m As String, org As Long
Dim i As Long, j As Long, pos As Integer, s As Integer, PrFx, SuFx, nPr As Long, nSu As Long
Dim clf, ref
ReDim clf(1 To plg.Rows.Count, 1 To 1)
If UBound(clefs) = -1 Then ref = Empty Else clf = clefs(0).Value: ref = clefs(1)
PrFx = Array(" ", Chr(160), "-", "(", ")", "[", "]", "{", "}", ",", ";", ".", """", Chr(147), Chr(171), Chr(133), ":", "/", "\", "!", "+", "_", "*", vbLf, vbCr)
SuFx = Array(" ", Chr(160), "-", "(", ")", "[", "]", "{", "}", ",", ";", ".", """", Chr(148), Chr(187), Chr(133), ":", "/", "\", "!", "+", "_", "*", vbLf, vbCr, "s ", "s" & Chr(160), "s" & vbLf, "s" & vbCr)
nPr = UBound(PrFx)
nSu = UBound(SuFx)
org = plg.Rows(1).Row - 1
For Each ar In plg.Areas
For Each cl In ar.Cells
If clf(cl.Row - org, 1) = ref Then
txt = " " & cl.Value & " "
If Len(txt) > Len(mot) + 1 Then
For i = 0 To nPr
For j = 0 To nSu
m = PrFx(i) & mot & SuFx(j): pos = InStr(1, txt, m, vbTextCompare)
Do While pos > 0: s = s + 1: pos = InStr(pos + Len(m) - 1, txt, m, vbTextCompare): Loop
Next j
Next i
End If
End If
Next cl
Next ar
compteMot9 = s
End Function[/COLOR][/B]