View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default How can I pass an array as TextToDisplay to a hyperlink?

What do you mean fails? What is the error message? What is the declaration
for CenterOnCell?

--
Regards,
Tom Ogilvy

"Jay Fincannon" wrote in message
...
I have a procedure that searches through every sheet (108) in a
workbook for matching data then puts a hyperlink to those data onto a
"Hyperlog" worksheet.

here's part of the code
Option Explicit
Option Base 1

Dim hlText(3) as String
Dim rte as string
Dim num as string
Dim street as string
Dim r as Integer
Dim foundNum as Range
.
.
.
r = 3
hlTarget:=foundNum 'result of Find"
a do loop here as long as matches are being found

hlText(1) = rte: hlText(2) = num: hlText(3) = street

Sheets("HyperLog").Hyperlinks.Add Anchor:=Cells(r, 1), _
Address:="", SubAddress:=rte & "!" & hlTarget, TextToDisplay:=hlText()

If I use hlText() or hlText, I get invalid argument error.
If I use hlText(3) only the 3rd element is passed
hlText(1) & hlText(2) & hlText(3) works except when executing the
hyperlink

Private Sub Workbook_SheetFollowHyperlink(ByVal Sh As Object, ByVal
Target As Hyperlink)
CenterOnCell Range Target.SubAddress, Target.TextToDisplay
End Sub
fails at .TextToDisplay
What do I do now coach?

Jay