Hey all, I created this macro in VBA:
This line:![]()
Please Login or Register to view this content.
secondary_last_name = Left(main_name, InStrRev(main_name, " ") + 1)
is supposed to extract:
DIAZ
in:
ROGELIO P DIAZ
Instead, it doesn't extract anything.
For example in this:
ROGELIO P DIAZ &W CLUADIA L
This line:
MsgBox secondary_first_name & " " & secondary_last_name
is supposed to return this:
CLUADIA L DIAZ
rather it returns this:
CLUADIA L ROGELIO P DIAZ
Not sure why the instrrev function is not returning the data to the right of the last space in the string main_name *(e.g. ROGELIO P DIAZ) in order to extract DIAZ.
Thanks for response.
Bookmarks