Check All Hyperlinks

lonely

Board Regular
Joined
Feb 28, 2003
Messages
230
Hi All,
I have aan excel sheet which has lot of hyperlinks. I have been trying to make a VB application which can check for the validity of all these hyperlinks. Please can someone help me with it.
thanks,
Lonely
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Try:
<pre><SPAN style="color:#00007F">Sub</SPAN> CheckLinks()
<SPAN style="color:#00007F">Dim</SPAN> h <SPAN style="color:#00007F">As</SPAN> Hyperlink
<SPAN style="color:#00007F">On</SPAN> <SPAN style="color:#00007F">Error</SPAN> <SPAN style="color:#00007F">Resume</SPAN> <SPAN style="color:#00007F">Next</SPAN>
<SPAN style="color:#00007F">For</SPAN> <SPAN style="color:#00007F">Each</SPAN> h <SPAN style="color:#00007F">In</SPAN> Worksheets(1).Hyperlinks
h.Follow
<SPAN style="color:#00007F">If</SPAN> Err.Number <> 0 <SPAN style="color:#00007F">Then</SPAN>
MsgBox h.Name & vbLf & " is not valid"
h.Range.ClearContents <SPAN style="color:#007F00">' or h.range.entirerow.delete</SPAN>
Err.Clear
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN>
<SPAN style="color:#00007F">Next</SPAN>
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></PRE>

regards,
Martin
 
Upvote 0
Hi Martin.
Thanks a lot for the help. Howevr, can you please tweak it a bit.
1. The invalid link should not be deleted. Instead, the next cell in the row should be populated with some indicatyor like "Link OK", "Link Invalid".

2. The valid links hould not be launched to open the web pages. Instead just the mesage "Link OK" can be posted as specified above.

3. A progress bar, if possible, would be great.

Thanks Again,
Lonely
 
Upvote 0

Forum statistics

Threads
1,215,019
Messages
6,122,707
Members
449,093
Latest member
Mnur

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