Log in

View Full Version : Remove Parts to URL



waldoctg
02-16-2016, 05:53 AM
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.

1815

Admin
02-16-2016, 08:46 AM
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)="/"))

Rick Rothstein
02-19-2016, 06:02 AM
This single formula should do what you want...

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

snb
02-19-2016, 03:04 PM
Sub M_snb()
Columns(1).Replace "*www.", ""
Columns(1).Replace "*://", ""
End Sub

Rick Rothstein
02-19-2016, 03:20 PM
Sub M_snb()
Columns(1).Replace "*www.", ""
Columns(1).Replace "*://", ""
End Sub
You forgot to remove trailing slash if there is one.