Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.links
Patricia Shannon
 
Posts: n/a
Default answer to odd results when comparing hyperlink addresses

I have written a VBA macro to check certain spreadsheets for valid syntax.
Certain cells are supposed to have hyperlinks, whose addresses are related to
the value of the cell, which in the case of cells with hyperlinks is also the
TextToDisplay value. I am currently adding a check for the hyperlinks.
Most of the time, the checking was fine, but I was getting a message for
some of the cells containing hyperlinks, that the hyperlink was wrong. When
I edited the hyperlink, it looked ok.
When I closed the hyperlink w/o making any changes, it then checked out as
valid!!!

I finally pinned down the problem. A clue : if I cancelled the hyperlink
editing, instead of closing it, it continued to get an error msg. I did
compares with Trim, and displayed Len, but could not find a problem there.
It turned out that the hyperlinks which give an error msg have a backward
slash (\) instead of a forward slash (/). When the hyperlink was edited,
they automatically changed to forward slash "/" in the editing window, and
were saved as such when the hyperlink edit was closed, but were unchanged by
a cancel. But when I did a compare on the hyperlink.address, to a string
generated by the macro which used "/", it of course did not compare as equal.

Also, when I hold the cursor over the cell (w/o clicking), which shows the
expanded hyperlink address, the separator shown is the backward slash ("\"),
regardless of what kind of separator is actually in the hyperlink. I am
embarrased that I looked at several Msgbox messages showing the actual
hyperlink.address, which showed the actual type of separator, w/o noticing
the difference.


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
XNPV vs. NPV(quarterly) different results magis Excel Worksheet Functions 3 January 6th 06 05:21 PM
copy/convert column email addresses Hyperlink "mailto:" excel97 daleman101 Excel Discussion (Misc queries) 3 November 3rd 05 01:21 PM
Using the Hyperlink Function and finding filenames Jeni Q Excel Worksheet Functions 0 September 20th 05 02:37 PM
calculating results in formulas Linda Excel Discussion (Misc queries) 9 July 6th 05 09:20 AM
Comparing contents of two spreadsheets and outputting results to a brx Excel Worksheet Functions 5 March 17th 05 01:44 AM


All times are GMT +1. The time now is 04:09 PM.

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"