View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Charlotte E Charlotte E is offline
external usenet poster
 
Posts: 59
Default Extract base domain from an URL?


In Excel 2003 VBA, how to quickly extract a base domain from a given URL?

I.e.

http://www.domain.net/sub1/sub2/etc/page.html
would become
http://www.domain.net/

or...

ftp://ftp.server.net/sub1
would become
ftp://ftp.server.net/

or...

www.website.net
would become
http://www.website.net/

and also secure sites

https://www.securesite.net/index.asp
would become
https://www.securesite.net/

and maybe even

ftp.site.net
would become
ftp://ftp.site.net/



TIA,