Parsing Full Names of varying lenths and parts
If you using excel 2000 or later, you can use the split command to put each
part of the name into an array
varr = split("John Winston Smith PHD")
? varr(0)
John
? varr(1)
Winston
? varr(2)
Smith
? varr(3)
PHD
so you could always check the last element of the array
titlecandidate = varr(ubound(varr))
If you don't want to use that, look at instrRev
sStr = "John Winston Smith PHD"
? Right(sStr,len(sStr)-instrRev(sStr," "))
PHD
Again, this requires xl2000 or later.
--
Regards,
Tom Ogilvy
"Dan" wrote in message
...
I am attempting to parse a Full name that includes First,
Middle, Last and some times PHD, MR or MRS.
I have the first name that was a left with a nested search
but search only works from left to right. I would like to
use right and some function that counts number of chactors
until reaching the space to the left of the last name.
Any Idea?s
|