+ Reply to Thread
Results 1 to 4 of 4

Truncating a String

  1. #1
    Registered User
    Join Date
    07-02-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    38

    Truncating a String

    Hey all,

    I am trying to write some code to take information in a cell and only store part of it to be used later in another cell.

    So A1 for example has Mr Disney, Walt, I would like to only store Disney, Walt.

    then in B2 is DL2458/MSY/11-may-13 12:29 the only part i would like to keep is the 12:29

    Any thoughts?

    Thank you,

    Matt

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Truncating a String

    The trick with doing something like this finding the common factor (there has to be one) which you can use to separate out the parts you want. From your two examples it appears that you want to keep everything after the first space. Is this correct?

  3. #3
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: Truncating a String

    Please Login or Register  to view this content.
    where Strng = the location of the text string ie B2 in your example
    tm is time (because you are looking at a time, you can change that if you wish)
    nm is name (because you are extracting a name) - it doesn't matter if it is Mr, Mr. or M, but if it is just Disney, Walt or D., Walt then it will only give you Walt
    you would prob do some sort of loop i'm guessing
    Last edited by scott.s.fower; 04-25-2013 at 04:31 PM.

  4. #4
    Registered User
    Join Date
    07-02-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Truncating a String

    Hey guys thank you for your help.

    In the first example, I would want to remove everything before the first space. On the second example I would like remove everything up to the last space. Can the be done from left or right?

    Thank you for your help,

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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