ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   hyperlinktext too long, any remedy? (https://www.excelbanter.com/excel-programming/367747-hyperlinktext-too-long-any-remedy.html)

John Smith

hyperlinktext too long, any remedy?
 
I'm trying to add hyperlink to cells. The following code works
fine only if the sTemp1 is short. If sTemp1 is long (more than 256
letters or something like that), the code won't work.

Is there a remedy? I can set the cell.value to sTemp1 first. But
then how do I add link to the cell?

================================================== ======
for Each cell In Worksheets("sheet1").Range([b1],
[b65536].End(xlUp)).Cells
..............
..............
If r = 0 Then

cell.Offset(0, 3).Formula = "=HYPERLINK(""" & hyperlinkaddress _
& sTemp & """,""" & sTemp1 & """)"

End If
next

NickHK

hyperlinktext too long, any remedy?
 
John,
I have to ask why on earth you need more than 256 chars.
It is supposed to be the "FriendlyName".

NickHK

"John Smith" wrote in message
...
I'm trying to add hyperlink to cells. The following code works
fine only if the sTemp1 is short. If sTemp1 is long (more than 256
letters or something like that), the code won't work.

Is there a remedy? I can set the cell.value to sTemp1 first. But
then how do I add link to the cell?

================================================== ======
for Each cell In Worksheets("sheet1").Range([b1],
[b65536].End(xlUp)).Cells
.............
.............
If r = 0 Then

cell.Offset(0, 3).Formula = "=HYPERLINK(""" & hyperlinkaddress _
& sTemp & """,""" & sTemp1 & """)"

End If
next




John Smith

hyperlinktext too long, any remedy?
 
I have a file full of dictionary entries. Some cells have links to
the dictionary. I managed to delete all the links (probably by
cell.value = string.) Now, I need to recreate the links.

The script I wrote works for short hyperlinktext such as

"to praise highly : GLORIFY"
"over again : ANEW"

but for long text like the following, it won't work.

"2 a : to remove utterly from recognition or memory b : to remove
from existence : destroy utterly all trace, indication, or
significance of c : to cause to disappear (as a bodily part or a
scar) or collapse (as a duct conveying body fluid) : REMOVE 4 <a
blood vessel obliterated by inflammation"

I have solved the problem. The following command is what I was
looking for.

activesheet.hyperlink.add



NickHK wrote:
John,
I have to ask why on earth you need more than 256 chars.
It is supposed to be the "FriendlyName".

NickHK

"John Smith" wrote in message
...

I'm trying to add hyperlink to cells. The following code works
fine only if the sTemp1 is short. If sTemp1 is long (more than 256
letters or something like that), the code won't work.

Is there a remedy? I can set the cell.value to sTemp1 first. But
then how do I add link to the cell?

================================================ ========
for Each cell In Worksheets("sheet1").Range([b1],
[b65536].End(xlUp)).Cells
.............
.............
If r = 0 Then

cell.Offset(0, 3).Formula = "=HYPERLINK(""" & hyperlinkaddress _
& sTemp & """,""" & sTemp1 & """)"

End If
next






All times are GMT +1. The time now is 11:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com