I have a table with the first and last names of people. I would like to sort by last name --which is the second word inside of the cell.
To further complicate this, some people have a middle initial which I would like to ignore.
How can i sort by last name in a table cell where some people have middle initials?
If you call for the last element of the string array, you'll have the last word of the line.
For the actual sorting, the easiest would probably be to have a new column containing only the last name, put there by macro or with a UDF. However, it's also possible to have a single macro handle the parsing and sorting all at once, but that also means adding a sorting algorithm to the VBA code, which might not be so simple if you've never done such things before (especially if you want the sorting to happen "inplace", which seems to be the case).