Function NomPrenom(x) As String
Dim s, i, indiv
s = Split(Application.Trim(x)): i = 0
Do
If estNom(s(i)) Then
indiv = indiv & ";" & s(i)
i = i + 1
If i > UBound(s) Then Exit Do
Do While estNom(s(i))
indiv = indiv & " " & s(i)
i = i + 1
If i > UBound(s) Then Exit Do
Loop
Do While estPrenom(s(i))
indiv = indiv & " " & s(i)
i = i + 1
If i > UBound(s) Then Exit Do
Loop
If i > UBound(s) Then Exit Do
indiv = indiv & " "
Else
indiv = indiv & ";" & s(i)
i = i + 1
If i > UBound(s) Then Exit Do
Do While estPrenom(s(i))
indiv = indiv & " " & s(i)
i = i + 1
If i > UBound(s) Then Exit Do
Loop
Do While estNom(s(i))
indiv = indiv & " " & s(i)
i = i + 1
If i > UBound(s) Then Exit Do
Loop
If i > UBound(s) Then Exit Do
indiv = indiv & " "
End If
Loop
indiv = Application.Trim(indiv)
If Len(indiv) > 0 Then indiv = Mid(indiv, 2)
NomPrenom = Replace(indiv, " ;", ";")
End Function