LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Workbook Cell as Target of Hyperlink Object

Hi all -

I'm trying to place a hyperlink in the ActiveCell with the hyperlink
pointing to a cell on a sheet in a closed workbook. I'm committed to using
the hyperlink object and not the function =Hyperlink(etc...).

The following code fails on the line before End Sub, presumably because the
variable hypAddress violates syntax rules for the "Address:=" argument of the
Hyperlinks.Add method. Any advice about constructing a valid string for the
hypAddress string variable would be appreciated.

Sub hLink()
iw = 7
folderPath = "G:\My Documents\"
fName = "Test.xls"

hypAddress= folderPath & fName & Sheets(iw).Name & "!A1")

ActiveSheet.Hyperlinks.Add Anchor:=ActiveCell, Address:=hypAddress,
TextToDisplay:=iw
End Sub

--
Jay
 
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
How do I hyperlink text in a cell to an embeded object Optagonal Excel Worksheet Functions 0 June 18th 08 12:13 AM
scrolling target cell to top of page after hyperlink BROCK8292 Excel Discussion (Misc queries) 6 September 21st 07 05:22 PM
Target cell reference moves when target is cut and pasted Illya Teideman Excel Discussion (Misc queries) 5 May 31st 07 11:34 AM
How find if target is object in Worksheet_Change (ByVal Target As.. ?) Gunnar Johansson Excel Programming 3 July 1st 04 09:25 PM
Placing the target cell after a hyperlink is executed Jon Rathbun Excel Programming 2 July 31st 03 11:32 PM


All times are GMT +1. The time now is 03:45 AM.

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"