LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default separating first and last names

Hi Tom

Try below, please

Option Explicit

Function Lastname(celle) As String
Dim Lastnamespace As String
Lastnamespace = InStrRev(celle, " ")
Lastname = Mid(celle, Lastnamespace + 1, Len(celle))
End Function

Function Firstname(celle) As String
Dim Lastnamespace As String
Lastnamespace = InStrRev(celle, " ")
Firstname = Mid(celle, 1, Lastnamespace - 1)
End Function

--
Best regards
Joergen Bondesen



"Tom G." wrote in message
...
I have a column with a variety of first and last name variations:

Joe Smith
Joe John Jones
Tom Jack Stuart Apple
Maria Lois Lane
Johann Sebastian Bach


I need to be able to sort them on their last name. Note that there is no
comma separating their names and that there can be any number of names,
HOWEVER, the last name always appears LAST.

Probably, in order to make some sort of order out of this mess, it would
be best if I create two separate columns: first names, last name.

Any help will be appreciated.

--


cheers,
Tom G



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Separating names Stewart99 Excel Discussion (Misc queries) 2 August 17th 07 01:53 AM
separating first and last names Tom G. Excel Discussion (Misc queries) 10 September 4th 06 04:20 PM
separating names mikeyVo Excel Worksheet Functions 2 July 20th 06 04:46 PM
Separating names Danno Excel Worksheet Functions 5 October 31st 05 12:29 AM
Separating first and last names Frank Kabel Excel Programming 0 March 4th 04 10:57 PM


All times are GMT +1. The time now is 05:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"