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

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

MartinK

Active Member
Joined
Oct 30, 2003
Messages
384
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
 

lonely

Board Regular
Joined
Feb 28, 2003
Messages
230
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
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,095
Messages
5,768,053
Members
425,451
Latest member
JohnBrooksBiddle

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
Top