Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Barb Reinhardt
 
Posts: n/a
Default Validating hyperlinks and text for hyperlink

I have an issue where I have hyperlinks that do not match the text that's
shown for them. I think what happened is that someone copied the cells down
and just changed the text, but not the hyperlink.

Here is an example of the problem.

Hyperlink displayed: www.microsoft.com
Link coded: www.yahoo.com

How can we validate which hyperlinks match and which ones don't?

Thanks in advance.

Barb Reinhardt
  #2   Report Post  
Earl Kiosterud
 
Posts: n/a
Default

Barb,

The following code will put the each hyperlink's address next to the cell.
And some other stuff which you can rem out. Insert four columns after your
column of hyperlinks before you run it.

Sub ValidateHyperlinks()
Dim link As Hyperlink

For Each link In ActiveSheet.Hyperlinks()
Cells(link.Range.Row, link.Range.Column).Offset(0, 1) = link.Name
Cells(link.Range.Row, link.Range.Column).Offset(0, 2) = link.Address
Cells(link.Range.Row, link.Range.Column).Offset(0, 3) = link.Range.Address
Cells(link.Range.Row, link.Range.Column).Offset(0, 4) = link.ScreenTip

Next link
End Sub

If you want the cell to show the URL, a similar loop could go through and
change them.
--
Earl Kiosterud
www.smokeylake.com

"Barb Reinhardt" wrote in message
...
I have an issue where I have hyperlinks that do not match the text that's
shown for them. I think what happened is that someone copied the cells
down
and just changed the text, but not the hyperlink.

Here is an example of the problem.

Hyperlink displayed: www.microsoft.com
Link coded: www.yahoo.com

How can we validate which hyperlinks match and which ones don't?

Thanks in advance.

Barb Reinhardt



  #3   Report Post  
Barb Reinhardt
 
Posts: n/a
Default

Can I do this without VBA?

"Earl Kiosterud" wrote:

Barb,

The following code will put the each hyperlink's address next to the cell.
And some other stuff which you can rem out. Insert four columns after your
column of hyperlinks before you run it.

Sub ValidateHyperlinks()
Dim link As Hyperlink

For Each link In ActiveSheet.Hyperlinks()
Cells(link.Range.Row, link.Range.Column).Offset(0, 1) = link.Name
Cells(link.Range.Row, link.Range.Column).Offset(0, 2) = link.Address
Cells(link.Range.Row, link.Range.Column).Offset(0, 3) = link.Range.Address
Cells(link.Range.Row, link.Range.Column).Offset(0, 4) = link.ScreenTip

Next link
End Sub

If you want the cell to show the URL, a similar loop could go through and
change them.
--
Earl Kiosterud
www.smokeylake.com

"Barb Reinhardt" wrote in message
...
I have an issue where I have hyperlinks that do not match the text that's
shown for them. I think what happened is that someone copied the cells
down
and just changed the text, but not the hyperlink.

Here is an example of the problem.

Hyperlink displayed: www.microsoft.com
Link coded: www.yahoo.com

How can we validate which hyperlinks match and which ones don't?

Thanks in advance.

Barb Reinhardt




  #4   Report Post  
Earl Kiosterud
 
Posts: n/a
Default

Barb,

I can't think of an automated way to check them, other than with VBA. You
could right-click each, click Edit Hyperlinks, and examine it manually
(address line).

Or click each, and see where it takes you. Not funny, I guess.
--
Earl Kiosterud
www.smokeylake.com

"Barb Reinhardt" wrote in message
...
Can I do this without VBA?

"Earl Kiosterud" wrote:

Barb,

The following code will put the each hyperlink's address next to the
cell.
And some other stuff which you can rem out. Insert four columns after
your
column of hyperlinks before you run it.

Sub ValidateHyperlinks()
Dim link As Hyperlink

For Each link In ActiveSheet.Hyperlinks()
Cells(link.Range.Row, link.Range.Column).Offset(0, 1) = link.Name
Cells(link.Range.Row, link.Range.Column).Offset(0, 2) = link.Address
Cells(link.Range.Row, link.Range.Column).Offset(0, 3) =
link.Range.Address
Cells(link.Range.Row, link.Range.Column).Offset(0, 4) = link.ScreenTip

Next link
End Sub

If you want the cell to show the URL, a similar loop could go through
and
change them.
--
Earl Kiosterud
www.smokeylake.com

"Barb Reinhardt" wrote in
message
...
I have an issue where I have hyperlinks that do not match the text
that's
shown for them. I think what happened is that someone copied the cells
down
and just changed the text, but not the hyperlink.

Here is an example of the problem.

Hyperlink displayed: www.microsoft.com
Link coded: www.yahoo.com

How can we validate which hyperlinks match and which ones don't?

Thanks in advance.

Barb Reinhardt






  #5   Report Post  
Barb Reinhardt
 
Posts: n/a
Default

I found the getaddr() function and that will get me what I want. Thanks for
the info. You gave me enough info to know what to look for.

"Earl Kiosterud" wrote:

Barb,

I can't think of an automated way to check them, other than with VBA. You
could right-click each, click Edit Hyperlinks, and examine it manually
(address line).

Or click each, and see where it takes you. Not funny, I guess.
--
Earl Kiosterud
www.smokeylake.com

"Barb Reinhardt" wrote in message
...
Can I do this without VBA?

"Earl Kiosterud" wrote:

Barb,

The following code will put the each hyperlink's address next to the
cell.
And some other stuff which you can rem out. Insert four columns after
your
column of hyperlinks before you run it.

Sub ValidateHyperlinks()
Dim link As Hyperlink

For Each link In ActiveSheet.Hyperlinks()
Cells(link.Range.Row, link.Range.Column).Offset(0, 1) = link.Name
Cells(link.Range.Row, link.Range.Column).Offset(0, 2) = link.Address
Cells(link.Range.Row, link.Range.Column).Offset(0, 3) =
link.Range.Address
Cells(link.Range.Row, link.Range.Column).Offset(0, 4) = link.ScreenTip

Next link
End Sub

If you want the cell to show the URL, a similar loop could go through
and
change them.
--
Earl Kiosterud
www.smokeylake.com

"Barb Reinhardt" wrote in
message
...
I have an issue where I have hyperlinks that do not match the text
that's
shown for them. I think what happened is that someone copied the cells
down
and just changed the text, but not the hyperlink.

Here is an example of the problem.

Hyperlink displayed: www.microsoft.com
Link coded: www.yahoo.com

How can we validate which hyperlinks match and which ones don't?

Thanks in advance.

Barb Reinhardt






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hyperlinks and sorting data Rena Excel Discussion (Misc queries) 0 June 3rd 05 07:50 PM
Random hyperlinks everywhere! FNORD Excel Discussion (Misc queries) 1 February 2nd 05 02:27 AM
Convert entire columns of text email addresses to hyperlinks TSA Excel Worksheet Functions 2 January 20th 05 04:31 PM
Creating multiple hyperlinks from a column where the text in the . OzGhostRiding Excel Worksheet Functions 5 December 14th 04 01:45 AM
Creating multiple hyperlinks from a column where the text in the . OzGhostRiding Excel Worksheet Functions 1 December 10th 04 04:11 AM


All times are GMT +1. The time now is 12:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"