Lanie,<br>
<br>
I wrote the following function for names. It has worked well so far.<br>
<br>
Mike<br>
<br>
Public Function MixCase(ByVal strTextIn As String) As String<br>
'This function returns a string where<br>
'the first letter of each word is upper case and<br>
'the rest of the letters of each word are lower case.<br>
'<br>
'It also handles Mc names, hyphens, and apostrophies.<br>
'<br>
'Thus when strTextIn = "BEE BOP bO LULA",<br>
'MixedCase = "Bee Bop Bo Lula"<br>
'Author: Mike Angelastro<br>
'Date: 3-20-2000<br>
<br>
Dim strTemp As String<br>
Dim strChar As String<br>
Dim intVowels As Integer<br>
Dim n As Long<br>
<br>
'Exit if input is null<br>
If IsNull(strTextIn) Then<br>
MixCase = " "<br>
Exit Function<br>
End If<br>
'Look for absence of vowels, in which case capitalize all letters.<br>
intVowels = InStr(1, strTextIn, "a", 1) Or InStr(1, strTextIn, "e", 1) Or InStr(1, strTextIn, "i", 1) Or InStr(1, strTextIn, "o", 1) Or InStr(1, strTextIn, "u", 1) Or InStr(1, strTextIn, "y", 1)<br>
If intVowels = 0 Then<br>
MixCase = UCase(strTextIn)<br>
Exit Function<br>
End If<br>
'Build output string.<br>
MixCase = UCase(Left(strTextIn, 1)) 'Capitalize the first letter of the string.<br>
For n = 2 To Len(strTextIn)<br>
strTemp = Right(strTextIn, Len(strTextIn) - n + 1) 'Derive the balance of the string in.<br>
strChar = Right(MixCase, 1) 'Derive the last character of the balance of string in.<br>
Select Case strChar<br>
Case "c"<br>
If Right(MixCase, 2) = "mc" Or Right(MixCase, 3) = "mac" Then 'Look for "Mc" or "Mac" names.<br>
MixCase = MixCase & UCase(Left(strTemp, 1)) 'Convert character to upper case.<br>
Else<br>
MixCase = MixCase & LCase(Left(strTemp, 1)) 'Convert character to lower case.<br>
End If<br>
Case ".", " ", "-", "'" 'Space, hyphen, period, or apostrophy.<br>
MixCase = MixCase & UCase(Left(strTemp, 1)) 'Convert character to upper case.<br>
Case Else<br>
If strChar <> "c" Then MixCase = MixCase & LCase(Left(strTemp, 1)) 'Convert character to lower case.<br>
End Select<br>
Next<br>
<br>
End Function