LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Using Excel Hyperlinks to refer to a Subroutine rather than a Cell

Hello Again -

I have found that given a list of worksheet names I can create hyperlinks to
those worksheets (let's say specifically Cell P2) using the following code:

ws.Activate

For row = tRow To bRow
ws.Cells(row, col).Select
With Selection
t2D = Selection.Value ' Note that the Cell value is the WS Name
subA = "'" & t2D & "'!P2"

.ClearContents
ws.Hyperlinks.Add Anchor:=Selection, Address:="",
SubAddress:=subA, TextToDisplay:=t2D
End With
Next

I can also scroll a worksheet to exactly the right cell using:

Sub scroll2Column(wsName)
Sheets(wsName).Activate
ActiveWindow.ScrollColumn = 16
ActiveSheet.Range("P2").Select
End Sub

I would like to combine these two concpets and create a hyperlink which
doesn't just refer to the cell but to the subroutine which brings the user to
the cell and then conviently scrolls the worksheet as well.

Despite many attempts at this, I have not gotten that to work.

Does anyone know how this might be done?

Thanks in advance,

Chris Tauss )
 
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
Call a subroutine using variable subroutine name dhstein Excel Discussion (Misc queries) 3 July 26th 09 08:28 PM
Help! Can't refer to a subroutine on a worksheet Duncan[_7_] Excel Programming 2 November 9th 06 01:09 PM
sql that will refer to a cell in excel zero6060 Excel Programming 1 August 17th 06 07:33 AM
Excel Hyperlinks- cell content v. hyperlinks herpetafauna Excel Discussion (Misc queries) 2 May 23rd 06 04:39 AM
How do I refer to the tab name in a cell formula in Excel? Steven Reames Excel Discussion (Misc queries) 1 August 3rd 05 07:22 PM


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