tranthanhan1962 > 24-06-15, 04:15 PM
Function Xoakhoangtrang(DoanText As String)
Dim XulyDoanText As String
XulyDoanText = RTrim(DoanText)
Do While InStr(XulyDoanText, " ") > 0
XulyDoanText = Left(XulyDoanText, InStr(XulyDoanText, " ") - 1) & Mid(XulyDoanText, InStr(XulyDoanText, " ") + 1)
Loop
Xoakhoangtrang = Trim(XulyDoanText)
End Function
Function HoVaTen(strHoTen As String)
Dim XulystrHoTen As String
Dim SoChu, SoLan As Integer
XulystrHoTen = RTrim(strHoTen)
Do While InStr(XulystrHoTen, " ") > 0
XulystrHoTen = Left(XulystrHoTen, InStr(XulystrHoTen, " ") - 1) & Mid(XulystrHoTen, _
InStr(XulystrHoTen, " ") + 1)
Loop
XulystrHoTen = Trim(XulystrHoTen)
SoChu = Len(XulystrHoTen)
HoVaTen = UCase(Left(XulystrHoTen, 1))
For SoLan = 1 To SoChu - 1
If Mid(XulystrHoTen, SoLan, 1) = " " Then
HoVaTen = HoVaTen & UCase(Mid(XulystrHoTen, SoLan + 1, 1))
Else
HoVaTen = HoVaTen & LCase(Mid(XulystrHoTen, SoLan + 1, 1))
End If
Next SoLan
End Function