Function parseLastName(fullname As String) As String
Dim curstr As String Dim leng As Integer, p As Integer curstr = "" leng = Len(Trim(fullname)) While curstr <> " " DoEvents p = InStr(leng, fullname, " ", vbTextCompare) If p <> 0 Then curstr = Mid(fullname, p, 1) End If leng = leng - 1 Wend parseLastName = Mid(fullname, p, (Len(fullname) - p) + 1) End Function |