Function CompteSequence(Plage, pattern, Optional caseSensitive = 0) As Integer
Dim regex As Object, Ary As Variant, i As Long
Dim bm As New cBenchmark
Ary = Plage.Value
bm.TrackByName "Copie Plage"
Set regex = CreateObject("VBScript.RegExp")
regex.pattern = pattern
regex.IgnoreCase = caseSensitive
CompteSequence = 0
bm.TrackByName "Create Regex"
For i = 1 To UBound(Ary)
If regex.Test(Ary(i, 1)) Then CompteSequence = CompteSequence + 1
bm.TrackByName "Regex"
Next i
bm.TrackByName "Fin"
End Function