CokeOrCrack
Board Regular
- Joined
- Dec 13, 2015
- Messages
- 81
- Within a userform, I have a textbox in which applicants type their last name
- Some last names contain multiple capital letters (e.g. "McDonald")
- The Proper Case function only capitalizes the first letter of each name and forces the remainder as lower case
Question
- Is there a way to capitalize multiple letters within the textbox, but not all the letters?
Notes
- My current code is proper case and will not allow for a capital internally
Thanks
OJ
- Some last names contain multiple capital letters (e.g. "McDonald")
- The Proper Case function only capitalizes the first letter of each name and forces the remainder as lower case
Question
- Is there a way to capitalize multiple letters within the textbox, but not all the letters?
Notes
- My current code is proper case and will not allow for a capital internally
Code:
Private Sub tbLastName_Exit(ByVal Cancel As MSForms.ReturnBoolean)
tbLastName.Value = Application.WorksheetFunction.Proper(tbLastName.Value)
tbLastName.Value = Application.Trim(tbLastName.Value)
If tbLastName.Value = vbNullString Then
MsgBox "Enter Last Name"
Cancel = True
End If
End Sub
Thanks
OJ