Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I pass an array as TextToDisplay to a hyperlink?
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I pass an array as TextToDisplay to a hyperlink?
Error message
Compile error: Type mismatch: array or user-defined type expected CenterOnCell(OnCell as Range, Street() as String) What do you mean fails? What is the error message? What is the declaration for CenterOnCell? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I pass an array as TextToDisplay to a hyperlink?
If you do this:
Sheets("HyperLog").Hyperlinks.Add Anchor:=Cells(r, 1), _ Address:="", SubAddress:=rte & "!" & _ hlTarget, TextToDisplay:=hlText(1) & hlText(2) & hlText(3) then you must declare CenterOnCell as CenterOnCell(OnCell as Range, Street as String) and process Street as a string, not an array. -- Regards, Tom Ogilvy "Jay Fincannon" wrote in message ... Error message Compile error: Type mismatch: array or user-defined type expected CenterOnCell(OnCell as Range, Street() as String) What do you mean fails? What is the error message? What is the declaration for CenterOnCell? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I pass an array as TextToDisplay to a hyperlink?
Thank you Tom
Jay On Thu, 27 Jan 2005 18:13:02 -0500, "Tom Ogilvy" wrote: If you do this: Sheets("HyperLog").Hyperlinks.Add Anchor:=Cells(r, 1), _ Address:="", SubAddress:=rte & "!" & _ hlTarget, TextToDisplay:=hlText(1) & hlText(2) & hlText(3) then you must declare CenterOnCell as CenterOnCell(OnCell as Range, Street as String) and process Street as a string, not an array. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
combining cells and array from different sheets into an array to pass to IRR() | Excel Discussion (Misc queries) | |||
Pass an array to Rank | Excel Worksheet Functions | |||
Hyperlink TexttoDisplay | Excel Programming | |||
Pass array of worksheets to ActiveX DLL (VB6) | Excel Programming | |||
Pass array from Project to Excel | Excel Programming |