Sharid
Well-known Member
- Joined
- Apr 22, 2007
- Messages
- 1,064
- Office Version
- 2016
- Platform
- Windows
I want to trim a url with vba code so the url will give me the domain name ONLY, from the url below I want the word google
Urls will be in A1 down as the list is dynamic. I will have a command button on on a userform, url will be in fourth sheet called "Sheet4"
However,
The first formula only works on https and not http as I have to -12 and the second formual looks for the first "." and removes every thing after it and -1
Also the formual is in two columns, so three columns are used A,B,C, where as I wanted it to change all the results in column A and then convert to values and not show as formulas,
Thanks having a look
Urls will be in A1 down as the list is dynamic. I will have a command button on on a userform, url will be in fourth sheet called "Sheet4"
- This is in B1 down
=RIGHT(A1,LEN(A1)-12)
and gives me, google.com/search?q=google+news&oq=google+&aqs=chrome.0.69i59j0l5j69i57j0.8860j0j8&sourceid=chrome&ie=UTF-8 - This is in C1 down
=LEFT(B1,FIND(".",B1)-1)
and this Give me google
However,
The first formula only works on https and not http as I have to -12 and the second formual looks for the first "." and removes every thing after it and -1
Also the formual is in two columns, so three columns are used A,B,C, where as I wanted it to change all the results in column A and then convert to values and not show as formulas,
Thanks having a look