Function GetInitials(myName As String) As String
Dim myLen As Long
Dim i As Long
Dim myInit As String
myLen = Len(myName)
' Exit function if zero length string
If myLen = 0 Then Exit Function
' Get first letter
myInit = Left(myName, 1)
' Loop through name
If myLen > 2 Then
For i = 2 To myLen - 1
If Mid(myName, i, 1) = " " Then
myInit = myInit & Mid(myName, i + 1, 1)
End If
Next i
End If
' Return value
GetInitials = myInit
End Function