#1   Report Post  
Posted to microsoft.public.excel.misc
phil1ray
 
Posts: n/a
Default Building a TOC


Over a year ago a member of this forum directed me to a web sight with
the code for a macro to build a table of contents in a work book. I
have since deleted the macro and now I need it again. Can anyone help.

Thanks


--
phil1ray
------------------------------------------------------------------------
phil1ray's Profile: http://www.excelforum.com/member.php...fo&userid=6416
View this thread: http://www.excelforum.com/showthread...hreadid=510909

  #2   Report Post  
Posted to microsoft.public.excel.misc
JMB
 
Posts: n/a
Default Building a TOC

I don't know the web site, but are you trying to generate a list (hyperlinks)
of the sheets in your workbook? You could do that with (or something like)
the following (which begins the list in the active cell - be sure not to
overwrite anything you need):

Sub TOC()
Dim i As Long
Dim Counter As Long
Counter = 0

For i = 1 To Sheets.Count
If Sheets(i).Name < ActiveSheet.Name Then
ActiveSheet.Hyperlinks.Add Anchor:=ActiveCell.Offset(Counter, 0), _
Address:="", SubAddress:=Sheets(i).Name & "!A1", _
TextToDisplay:=Sheets(i).Name
Counter = Counter + 1
End If
Next i

End Sub



"phil1ray" wrote:


Over a year ago a member of this forum directed me to a web sight with
the code for a macro to build a table of contents in a work book. I
have since deleted the macro and now I need it again. Can anyone help.

Thanks


--
phil1ray
------------------------------------------------------------------------
phil1ray's Profile: http://www.excelforum.com/member.php...fo&userid=6416
View this thread: http://www.excelforum.com/showthread...hreadid=510909


  #3   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Building a TOC

I bet it was David McRitchie's site:
http://www.mvps.org/dmcritchie/excel/buildtoc.htm

phil1ray wrote:

Over a year ago a member of this forum directed me to a web sight with
the code for a macro to build a table of contents in a work book. I
have since deleted the macro and now I need it again. Can anyone help.

Thanks

--
phil1ray
------------------------------------------------------------------------
phil1ray's Profile: http://www.excelforum.com/member.php...fo&userid=6416
View this thread: http://www.excelforum.com/showthread...hreadid=510909


--

Dave Peterson
Reply
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
building a web site Paul Excel Discussion (Misc queries) 0 January 27th 06 01:26 AM
breakdown of buying land and building a home costs Jeff Excel Discussion (Misc queries) 0 September 10th 05 04:03 AM
a template for tracking house building costs kevy Excel Discussion (Misc queries) 0 August 15th 05 09:16 PM
I need a template to track expense + VAT when building a house ScottBarbery Excel Discussion (Misc queries) 1 June 23rd 05 03:02 PM
building invoice - strategy advice Excel Discussion (Misc queries) 0 January 3rd 05 01:29 PM


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