Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to make a cell permanently fixed | New Users to Excel | |||
How do I keep fixed and Non-fixed decimals on a sheet together? | Excel Worksheet Functions | |||
how do I insert the address of a selected cell into a fixed cell | Excel Discussion (Misc queries) | |||
drawdown at fixed rate over set period from investment at fixed % | New Users to Excel | |||
Fixed cell references | Excel Discussion (Misc queries) |