![]() |
|
#2
|
|||
|
|||
|
I used the macro recorder to see how/where Excel uses the sheet name.
Give this a try... Code:
Sub createHyperlinks_2()
'
' Macro to create hyperlinks
'
'
Dim tocText As String ' variable to hold text to appear in table of contents
Dim sh As String ' holds name of worksheet to be linked to
Dim selectedCell As Range ' holds cell reference of cell I want to be linked to
sh = ActiveSheet.Name
Set selectedCell = ActiveCell
tocText = ActiveCell.Text
Sheets("Table of Contents").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", _
SubAddress:=sh & "!" & selectedCell.Address, TextToDisplay:=tocText
End Sub
|
| Tags |
| hyperlinks, toc |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Reports Filter Generation | ebilbrough | Project | 3 | 01-05-2016 06:13 AM |
Awkward dropdown list generation
|
copwriter | Excel | 3 | 06-28-2014 05:59 PM |
Invoice Number Generation
|
mrphilk | Excel | 2 | 06-08-2010 12:39 PM |
| How to reduce top margin in even and odd pages in pdf generation using msword | Nandu4u | Word | 0 | 11-20-2009 07:16 AM |
| Templates: automatic text generation from Rich Text content control | Chickenmunga | Word | 0 | 10-01-2008 11:16 AM |