Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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
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
combining cells and array from different sheets into an array to pass to IRR() [email protected] Excel Discussion (Misc queries) 3 September 11th 06 07:17 AM
Pass an array to Rank Biff Excel Worksheet Functions 12 June 29th 05 04:15 PM
Hyperlink TexttoDisplay James[_32_] Excel Programming 5 September 27th 04 01:59 PM
Pass array of worksheets to ActiveX DLL (VB6) Hank Scorpio Excel Programming 25 June 21st 04 10:53 AM
Pass array from Project to Excel Sarah[_5_] Excel Programming 2 April 12th 04 07:30 PM


All times are GMT +1. The time now is 08:29 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"