LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 100
Default TOC with link to fixed cell, NOT tab

Hi all

Is there a way to modify the follow code so that the title in the TOC
worksheet link to a fixed cell (eg A1) rather than the tab "name" in which
the length of wording was limited.

(the following code was from JW who had helped me in my previous ?) tnks

Sub createTOC()
Dim ws As Worksheet, wsNw As Worksheet
Dim n As Integer
Set wsNw = ActiveWorkbook.Worksheets _
.Add(Befo=ActiveWorkbook.Sheets(1))
With wsNw
starter:
On Error GoTo errHandler
.Name = "TOC"
On Error GoTo 0
.[A1] = "Table Of Contents"
.[A2] = ActiveWorkbook.Name & " Worksheets"
.[A1].Font.Size = 14
.[A2].Font.Size = 10
n = 4
For Each ws In ActiveWorkbook.Worksheets
If ws.Name < .Name And ws.Visible = True Then
.Cells(n, 1) = ws.Name
.Hyperlinks.Add _
Anchor:=.Cells(n, 1), _
Address:="", _
SubAddress:="'" & ws.Name & "'!A1"
n = n + 1
End If
Next
End With
Columns("A:A").EntireColumn.AutoFit
Exit Sub
errHandler: Application.DisplayAlerts = False
Sheets("TOC").Delete
Application.DisplayAlerts = True
GoTo starter
End Sub


 
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 to make a cell permanently fixed Omer New Users to Excel 1 June 18th 07 08:09 PM
How do I keep fixed and Non-fixed decimals on a sheet together? kpike Excel Worksheet Functions 2 June 22nd 06 12:33 AM
how do I insert the address of a selected cell into a fixed cell cox Excel Discussion (Misc queries) 2 May 27th 06 07:44 PM
drawdown at fixed rate over set period from investment at fixed % jamook New Users to Excel 1 November 28th 05 10:53 PM
Fixed cell references rhythm_man Excel Discussion (Misc queries) 2 July 5th 05 01:14 PM


All times are GMT +1. The time now is 12:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"