Function ncancr(r, v)
'fonction qui renvoie les numéros NCA (v=1) ou NCR(v=2) se trouvant dans la chaine de caractères r
'
r = Replace(Replace(Replace(Replace(r, "NCA", ""), "NCR", ""), "/", " "), ".", " ")
t = Split(r & " ", " ")
nca = ""
ncr = ""
For i = LBound(t) To UBound(t)
If t(i) <> "" Then
If t(i) Like "####" Then
nca = nca & IIf(nca = "", "", " / ") & t(i)
ElseIf t(i) Like "#####" Then
ncr = ncr & IIf(ncr = "", "", " / ") & t(i)
'Else
' Exit For
End If
End If
Next i
If v = 1 Then
ncancr = nca
Else
ncancr = ncr
End If
End Function