+ Reply to Thread
Results 1 to 4 of 4

Extracting certain text from text string

  1. #1
    Forum Contributor
    Join Date
    04-19-2009
    Location
    Toulouse, France
    MS-Off Ver
    Excel 2010
    Posts
    130

    Extracting certain text from text string

    Hello all,

    I have a list of urls on sheet 1 of my workbook that always appear like so.


    HTML Code: 
    These appear from cell A1 to A"(The number varies). I would like to extract the names only from these strings and have them placed in order on sheet 3. So in example 3 moscow-flight (would it be possible to replace the - with a space) example 2 beachland vieri etc. I have looked at split and InStr but can't get it to work. They will always look like the above with all the text that comes before the names the same. Any ideas. Thankyou.

    Regards
    Dan

  2. #2
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: Extracting certain text from text string

    See: Cicada_Book1.xlsm
    Run: CopyNames2WkSheet

    The code is:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-20-2012
    Location
    New York, NY
    MS-Off Ver
    Excel 2013, 2010, 2007, 2003
    Posts
    99

    Re: Extracting certain text from text string

    You could do this very quickly with Text-to-Columns, "/" delimited, and then Find and Replace "-" with " "
    SPARTAN
    Please click the * if my solution helped

  4. #4
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: Extracting certain text from text string

    This is a complicated formula but this works. In cell C2 put this formula:
    =SUBSTITUTE(MID(B2,FIND("/",B2,FIND("/",B2,FIND("/",B2,FIND("/",B2,FIND(".",B2))+1)+1)+1)+1,FIND("/",B2,FIND("/",B2,FIND("/",B2,FIND("/",B2,FIND("/",B2,FIND(".",B2))+1)+1)+1)+1)-FIND("/",B2,FIND("/",B2,FIND("/",B2,FIND("/",B2,FIND(".",B2))+1)+1)+1)-1),"-"," ")

    Copy the formula down

    Kirk
    Click on star (*) below if this helps

+ 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