Thread: EXCEL FORMULAS
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
COM COM is offline
external usenet poster
 
Posts: 40
Default EXCEL FORMULAS

If the list of names is one string "John Smith" Then you need to first "split" the name, pulling first and last name into each strFirst and strLast, then reconstruct the string with strLast + " " + strFirst. Of course that will not work well if there are other punctuation marks in the string or if there is a middle initial.

So you can do a find on the original text for a space (" ") this result will give you a number, the number represents how many characters into the string the space is. This number can also be used to get that number of LEFT characters which would be stored as the strLast name. The total number of characters in the string, minus the number returned by the find would give you the RIGHT part of the string to be stored as strFirst. I know it's not VB code, but this pseudo code should get you going.