+ Reply to Thread
Results 1 to 4 of 4

truncate a string x characters after a delimiter

  1. #1
    Registered User
    Join Date
    11-06-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    18

    truncate a string x characters after a delimiter

    hello,
    i have a combobox form control that has a list of names in it in the format of "lastname, firstname" i need to convert that string to "lastname, f." for an if command that comes next. i don't know how to shorten the string correctly as the first name doesn't always start with the same letter (obviously) and the last name won't always be the same number of characters.
    what i do know is the comma delimiter will always be in the same spot and the space will always be after it. also it's safe to assume there will only be 1 comma per string, and there will never be middle names or initials.

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: truncate a string x characters after a delimiter

    maybe
    Please Login or Register  to view this content.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Registered User
    Join Date
    11-06-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: truncate a string x characters after a delimiter

    i need to put a note on my monitor so i stop forgetting about InStr. this worked perfectly thank you!

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: truncate a string x characters after a delimiter

    Glad to help. Thanks for the reputation.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Truncate text in a cell after so many words or characters
    By theblade24 in forum Excel General
    Replies: 9
    Last Post: 06-07-2013, 01:29 PM
  2. How to Truncate first 80 characters by keeping meaningful word in end
    By Rens243 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-02-2013, 04:17 AM
  3. Replies: 3
    Last Post: 09-09-2010, 10:41 AM
  4. Truncate all characters left of 6th character
    By fredmeister in forum Excel General
    Replies: 3
    Last Post: 02-09-2010, 04:41 PM
  5. Replies: 4
    Last Post: 01-13-2006, 09:55 AM

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