Function Arrivee(course$, plageref As Range)
Arrivee = ""
If Not course Like "*-*" Then Exit Function
Dim s, reunion$, ncourse%, t, ub&, a(), i&, j&
s = Split(course, "-")
reunion = Replace(s(0), ".", "") & " *"
ncourse = Val(Replace(s(1), "C.", ""))
t = plageref.Parent.UsedRange.Resize(, 9) 'matrice, plus rapide
ub = UBound(t)
ReDim a(1 To 3)
For i = 1 To ub
If t(i, 1) Like reunion Then
'maxcourse déclarée Public dans l'autre module
For j = i + 1 To Application.Min(ub, i + maxcourse)
If Val(t(j, 1)) = 0 Then Exit Function
If Val(t(j, 1)) = ncourse Then
If Val(t(j, 9)) = 0 Then Exit Function
s = Split(t(j, 9), "-")
ub = UBound(s)
a(1) = Val(s(0))
If ub Then a(2) = Val(s(1)) Else a(2) = ""
If ub > 1 Then a(3) = Val(s(2)) Else a(3) = ""
Arrivee = a 'vecteur ligne
Exit Function
End If
Next j
End If
Next i
End Function