I am pulling my hair out over this one.
I have a name that should be LastName1(space)LastName2(comma)(space)FirstName
Example: De Lahoya, Oscar
For some reason the Trim function 'apparently' is leaving two spaces between the two last names.
I have also tried an ASCII check:
Still shows '2 spaces' between the last names.
I just don't know what else to try.
Any ideas?
I have a name that should be LastName1(space)LastName2(comma)(space)FirstName
Example: De Lahoya, Oscar
For some reason the Trim function 'apparently' is leaving two spaces between the two last names.
VBA Code:
Sub PeskyName()
'
Dim PeskyName As String
'
PeskyName = " De Lahoya, Oscar "
'
Debug.Print PeskyName
Debug.Print Trim(PeskyName)
End Sub
I have also tried an ASCII check:
VBA Code:
Case 65 To 90, 97 To 122, 32, 44 To 45: 'Keep only Upper/Lowercase, space, comma, hyphen ... skip/strip anything else found in the name
Still shows '2 spaces' between the last names.
I just don't know what else to try.
Any ideas?