Function premot(s As String)

Dim mot1 As String
Dim posespaces  As Integer

phrase = Trim(s)

espaces = InStr(phrase, " ")        ' trouver le separateur
point = InStr(phrase, ";")
virgule = InStr(phrase, ",")
posespaces = 0

If espaces > point Then             ' trouver le separateur qui est le plus proche
posespaces = point
Else
posespaces = espaces
End If

If posespaces > virgule Then
posespaces = virgule
End If

If posespaces = 0 Then              ' trouver le mot
    GoTo 200
Else
    mot1 = Left(phrase, posespaces - 1)
    GoTo 200
End If

200
premot = mot1
End Function

    Source: geocities.com/manuhoro