+ Reply to Thread
Results 1 to 3 of 3

split name from prefixes

Hybrid View

WCJanssen split name from prefixes 12-21-2010, 03:09 PM
Bob Phillips Re: split name from prefixes 12-21-2010, 03:21 PM
WCJanssen Re: split name from prefixes 12-22-2010, 11:11 AM
  1. #1
    Registered User
    Join Date
    06-21-2009
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    Excel 2003, 2007
    Posts
    26

    Question split name from prefixes

    Hi,

    I'm looking for a code to seperate a name in a userform textbox from it's prefixes and copy both to different textboxes. So, if the user enters the (Dutch) name "van den berg" the code should copy "van den" to one textbox and "berg" to another. Any help appreciated; thanks in advance.
    Last edited by WCJanssen; 12-22-2010 at 11:11 AM.

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: split name from prefixes

    Maybe

        pos = InStrRev(txtName.Text, " ")
        txtSurname.Text = Mid$(txtName.Text, pos + 1, Len(txtName.Text) - pos)
        txtForename.Text = Replace(txtName, " " & txtSurname.Text, "")

  3. #3
    Registered User
    Join Date
    06-21-2009
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    Excel 2003, 2007
    Posts
    26

    Re: split name from prefixes

    Perfect, thanks a lot!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1