PDA

View Full Version : Solved: hyperlinks() syntax



grichey
07-22-2009, 10:24 AM
Hello,

Anyone know the way hyperlinks() is used? If I used hyperlinks(1) to return a hyperlink, it works fine, however using this on a cell that doesn't have a hyperlink is an error.

I'm wondering if there is an attribute of the hyperlinks that you can use to see if one exists.

Thanks

p45cal
07-22-2009, 04:27 PM
A range's hyperlinks property has a count property. If this is greater than zero then do something, else don't:
if range("A1").hyperlinks.count > 0 then... or you could use one of the 2 suggestions made in your thread which spawned this one.