pr2-eugin
Super Moderator
- Local time
- Today, 14:03
- Joined
- Nov 30, 2011
- Messages
- 8,494
My other only guess is that the String does not even have a Comma in it.. So lets do this..
Code:
Public Function properName(inputStr As String) As String
[COLOR=Green]'**********************
'Code Courtesy of
' Paul Eugin
'**********************[/COLOR]
[COLOR=Blue]On Error GoTo errHandler[/COLOR]
Dim tmpStr As String
If InStr(inputStr, ",") <> 0 Then
tmpStr = Mid(inputStr, InStr(inputStr, ",") + 1)
tmpStr = tmpStr & " " & Mid(inputStr, 1, InStr(inputStr, ",") - 1)
Else
tmpStr = inputStr
End If
properName = Trim(StrConv(tmpStr, vbProperCase))
[COLOR=Blue]exitFunc:[/COLOR]
[COLOR=Blue] Exit Function[/COLOR]
[COLOR=Blue]errHandler:
properName = vbNullString
Resume exitFunc[/COLOR]
End Function