Return live URLs

John Caines

Well-known Member
Joined
Aug 28, 2006
Messages
1,155
Office Version
  1. 2019
Platform
  1. Windows
Hi All.
Hope someone can help me out here.
Basically I have a long list of URLs in Col A From A2 down, here's a screenshot
Book1
AB
1URLsRETURNED URLS
2http://www.abalkhailrealestate.comhttp://www.abalkhailrealestate.com
3http://www.dirc.aehttp://www.dirc.ae
4http://www.luckydealuae.comhttps://luckydealuae.com/
5
6http://www.amberrealestate.aehttp://www.amberrealestate.ae
7http://www.househuntersdubai.comhttp://www.househuntersdubai.com
8
9http://www.espace.aehttps://www.espace.ae/
Sheet1


What I'm looking to do is just test each URL that is listed in Col A and return whatever the LIVE URL is (returned in Col B).
That's it!
I've tried to find solutions online, but they all either delete empty spages or remove duplicates etc etc
I just need to test whatever is in Col A and return a result on the same row in COL B

Some URLs tested and returned (Col B) might go from http to https, or maybe from www. to non www. etc etc, or maybe even redirect to a different domain extention, IE from .com to .co.uk

If it's a VBA solution (Which I'm guessing it needs to be) it can have a long timeout period for each URL, (maybe 20 seconds even) as some URLs I'm looking at are abroad, and could be on a slow server etc
The Most URLs that will be in Col A will probably never go over 1,000

I really hope someone can help me out here
I've spent ages trying to find something online to do this, and I just don't see 1 :(

Many thanks in advance, and hope everyone has a great New Year, even with this Covid around
(BTW) 1st time I'm trying out the xl2bb addin!
Hope it displays my URL examples ok!

Very Best regards
John C
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi there,,,
Just to add,
If it's easier,, you could return changed results in Col B,, and so then combine Changed results and original URLs that are still currently live) all into Col C

Whatever is easier.
Way above me,,, just trying to think aloud and give maybe another alternative

Many thanks again

Happy New Year to you all
Best Regards
John C
 
Upvote 0
Maybe here's the solution for you

 
Upvote 0
Hi Navic!!
Many thanks for your reply, I've just seen it come in!
Great stuff,,,

Man, this looks like some serious code!

I'll take a look now.
Many thanks for this find, I'll see how it runs.

Thanks again Navic
I'll let you know how it works out!
Best regards
John C
 
Upvote 0
Hi Navic,
Sorry but I couldn't get this to run for me so I don't even know what the end result would look like.
I have a test sheet here, and it throws up an error when I clcik to run on the vba buitton
I also attach image of the vba error that is being thrown up

I'm not 100% sure if this would give the correct result Navic as reading what the original poster said;
--------------------------
If it is a valid image URL, it continues to the next without taking action on the cell.

If it's invalid, then the cell value (ie the URL) is removed, and the function moves to the next cell in the column.
--------------------------
I don't know how this would work with redirected URLs,, IE if the original was say http and the LIVE url is now https would it return this or not?

I don't know why this is broken, so I can't test it :(
Many thanks though Navic,,
This is kind of on the right track I'm guessing.

Hope someone can work out a solution to my post as it would be really really handy.

Best regards Navic
And happy new year BTW!
John C
 

Attachments

  • vba-error.jpg
    vba-error.jpg
    80.3 KB · Views: 5
Upvote 0

Forum statistics

Threads
1,215,039
Messages
6,122,802
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top