Results 1 to 5 of 5

Thread: Remove Parts to URL

  1. #1
    Junior Member
    Join Date
    Feb 2016
    Posts
    1
    Rep Power
    0

    Remove Parts to URL

    Also, can you make one for me to just get rid of any http://; https://; www.; http://www.; https://www.; as well as "/" at the end? Like shown in the example below.

    Screen Shot 2016-02-15 at 7.51.53 PM.jpg

  2. #2
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Hi

    Welcome to board.

    If the URL in A1,

    in B1

    =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(LOWER(A1),"https ://",""),"http://",""),"www.","")

    and in C1

    =LEFT(B1,LEN(B1)-(RIGHT(B1)="/"))
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  3. #3
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    662
    Rep Power
    14
    This single formula should do what you want...

    =MID(SUBSTITUTE(LEFT(A1,LEN(A1)-(RIGHT(A1)="/")),"www.",""),IFERROR(FIND("://",A1)+3,1),999)

  4. #4
    Senior Member
    Join Date
    Jun 2012
    Posts
    337
    Rep Power
    13
    Code:
    Sub M_snb()
       Columns(1).Replace "*www.", ""
       Columns(1).Replace "*://", ""
    End Sub

  5. #5
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    662
    Rep Power
    14
    Quote Originally Posted by snb View Post
    Code:
    Sub M_snb()
       Columns(1).Replace "*www.", ""
       Columns(1).Replace "*://", ""
    End Sub
    You forgot to remove trailing slash if there is one.
    Last edited by Rick Rothstein; 03-14-2016 at 05:15 AM.

Similar Threads

  1. Replies: 30
    Last Post: 04-15-2019, 07:36 PM
  2. add hyperlink with the URL hardcoded in the code
    By saidineshbabu in forum Excel Help
    Replies: 2
    Last Post: 11-03-2013, 05:26 AM
  3. Opening URL @ new tab in Internet Explorer: VBA
    By Transformer in forum Tips, Tricks & Downloads (No Questions)
    Replies: 0
    Last Post: 09-11-2013, 08:22 PM
  4. Replies: 12
    Last Post: 07-31-2013, 05:44 PM
  5. Import html source of url list in each cell
    By Sergio Alfaro Lloret in forum Excel Help
    Replies: 8
    Last Post: 07-31-2012, 03:03 AM

Posting Permissions

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