Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've got a workbook with multiple hyperlinks in it. In this workbook i
a macro to verify the existance of each link. What I'd like to be able to do is select the cell of the broken lin (if and when one is found) and change the color of the cell. Here's what I've got for verifying the existance of the links (sorry, don't remeber who I "borrowed" this from in this forum). Public Sub VerifyLinks() Dim sAddr As String Dim lnk As Hyperlink For Each lnk In ActiveSheet.Hyperlinks sAddr = lnk.Address Debug.Print lnk.Address If Dir(sAddr) = "" Then MsgBox "Link NOT found!" ' Select cell and change color Else MsgBox "Link found!" End If Next End Sub Thanks in advance! Matt -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if that successfully finds the broken link, then to color the cell:
Public Sub VerifyLinks() Dim sAddr As String Dim lnk As Hyperlink For Each lnk In ActiveSheet.Hyperlinks sAddr = lnk.Address If Dir(sAddr) = "" Then 'MsgBox "Link NOT found!" ' Select cell and change color lnk.parent.Interior.ColorIndex = 6 Else 'MsgBox "Link found!" End If Next End Sub -- Regards, Tom Ogilvy "BVHis " wrote in message ... I've got a workbook with multiple hyperlinks in it. In this workbook is a macro to verify the existance of each link. What I'd like to be able to do is select the cell of the broken link (if and when one is found) and change the color of the cell. Here's what I've got for verifying the existance of the links (sorry, I don't remeber who I "borrowed" this from in this forum). Public Sub VerifyLinks() Dim sAddr As String Dim lnk As Hyperlink For Each lnk In ActiveSheet.Hyperlinks sAddr = lnk.Address Debug.Print lnk.Address If Dir(sAddr) = "" Then MsgBox "Link NOT found!" ' Select cell and change color Else MsgBox "Link found!" End If Next End Sub Thanks in advance! Matt W --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Broken Excel hyperlink to Word Template | Excel Discussion (Misc queries) | |||
hyperlink broken after email | Excel Worksheet Functions | |||
How do I create a hyperlink to a cell with the hyperlink function | Excel Worksheet Functions | |||
Copy hyperlink from one cell to/as hyperlink in another cell | Excel Worksheet Functions | |||
Hyperlink to another row broken if inserting new row between, Help | Excel Discussion (Misc queries) |