Try this and see what you get.
MsgBox StrConv("a!a@a#a$a%a^a&a(a{a[a;a.a_a-a+a=a'a*a|a\a/a:a?a>a<a~a""a", vbProperCase)
Then, try this
MsgBox fProperCase("a!a@a#a$a%a^a&a(a{a[a;a.a_a-a+a=a'a*a|a\a/a:a?a>a<a~a""a")
Code:Private Function fProperCase(strData As String) As String strData = StrConv(strData, vbProperCase) 'Will only take care of space Dim strDelim As String 'strDelim = "~!@#$%^&({[;_-+='""*|\/:?<>." 'Delete chars or Add additional chars strDelim = strDelim & fGrabChar(33, 47) strDelim = strDelim & fGrabChar(58, 64) strDelim = strDelim & fGrabChar(91, 96) strDelim = strDelim & fGrabChar(123, 126) strDelim = Replace(strDelim, ".", "", 1, , vbTextCompare) 'Get rid of period or it will interfere with file extention 'MsgBox strDelim Dim strChar As String Dim intPos As Integer Dim strZ As String Dim intX As Integer For intX = 1 To Len(strDelim) strZ = Mid(strDelim, intX, 1) 'Go through each of char in strDelim intPos = 0 Do 'Get position of current delimiter intPos = InStr(intPos + 1, strData, strZ, vbTextCompare) strChar = Mid(strData, intPos + 1, 1) If intPos = 0 Then Exit Do 'Check if anymore exist 'Update with a Ucase strData = Replace(strData, strZ & strChar, strZ & UCase(strChar), 1, , vbTextCompare) Loop Next fProperCase = strData End Function Private Function fGrabChar(intStart As Integer, intEnd As Integer) As String Dim intX As Integer For intX = intStart To intEnd fGrabChar = fGrabChar & Chr(intX) Next End Function


Reply With Quote