Hi,
See if this does the trick:
Public Function ExtractProperCase(ByVal sText As String)
Dim iChar As Integer
Dim iStart As Integer
Dim sReturn As String
For iChar = 1 To Len(sText)
iStart = iChar
If Asc(Mid$(sText, iChar, 1)) > 64 And _
Asc(Mid$(sText, iChar, 1)) < 91 Then
Do While Mid$(sText, iChar, 1) <> " " And _
iChar < Len(sText) + 1
iChar = iChar + 1
Loop
sReturn = sReturn & _
Mid$(sText, iStart, iChar - iStart) & " "
End If
Next
ExtractProperCase = Trim$(sReturn)
End Function
I haven't checked the asc numbers so I'll have to trust whoever wrote the original function on that one.
Cheers,
Dom
Bookmarks