+ Reply to Thread
Results 1 to 5 of 5

Delete all characters after slash

  1. #1
    Registered User
    Join Date
    08-06-2013
    Location
    Georgia
    MS-Off Ver
    Excel 2007
    Posts
    5

    Delete all characters after slash

    Hello.
    I have the pinterest board links in my excel doc.
    For example: http://pinterest.com/lejugedesegrais/doorways/
    http://pinterest.com/luccasoares/in-out/
    I want to remove the board names and leave only user names. Like this http://pinterest.com/lejugedesegrais/

    I use this formula: =LEFT(A1,LEN(A1)-FIND("/",A1)) It works for such links: http://pinterest.com/lejugedesegrais/
    but if the link contains character "-" it doesn't work and leaves http://pinterest.com/luccasoares/i

    Can any one help me in this formula? your help is very appreciated. Thank you in advance

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,598

    Re: Delete all characters after slash

    It has nothing to do with the - character. The FIND function in your formula will always return 6, as it finds the first / in your string (i.e. after http: ), and you are then subtracting that from the length of the string and returning that number of characters from the beginning of the string.

    Pete

  3. #3
    Forum Contributor
    Join Date
    08-02-2013
    Location
    Wageningen, The Netherlands
    MS-Off Ver
    365
    Posts
    495

    Re: Delete all characters after slash

    What Pete says. Plus, here's your solution:

    Since "http://pinterest.com/" is 21 characters long, use =LEFT(A1,FIND("/",A1,22))
    When I say semicolon, u say comma!

  4. #4
    Registered User
    Join Date
    08-06-2013
    Location
    Georgia
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Delete all characters after slash

    Thank you very much! It works. Thanks

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Delete all characters after slash

    you'r welcome. If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neat and tidy lol, and consider adding the reputation to those that helped (see points 2 & 3 below)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. [SOLVED] Delete characters and add * in front and last characters in ACCESS QUERY
    By LALTIZER in forum Access Tables & Databases
    Replies: 9
    Last Post: 02-01-2013, 02:06 PM
  2. Delete some characters
    By Anto_BT in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-20-2012, 11:44 AM
  3. [SOLVED] Characters.delete only works with less than 255 characters?
    By mexindian in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-26-2012, 11:57 AM
  4. Delete certain characters from cells...
    By amonty78 in forum Excel General
    Replies: 5
    Last Post: 08-18-2011, 01:04 PM
  5. Replies: 4
    Last Post: 12-08-2010, 01:28 PM

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