parentnomad.blogg.se

How to create table of contents in word 2010 automatically
How to create table of contents in word 2010 automatically







how to create table of contents in word 2010 automatically
  1. How to create table of contents in word 2010 automatically update#
  2. How to create table of contents in word 2010 automatically code#

Step 2 You can insert a table of content anywhere in the document, but the best place is always at the beginning of the document. Step 1 Consider a document having different levels of headings.

How to create table of contents in word 2010 automatically update#

However, Word will not automatically update the numbering if you move or delete tables or figures.

How to create table of contents in word 2010 automatically code#

  • On the Developer tab, in the Code group, click Macros. The following will help you to create Table of Contents in your Microsoft Word using various levels of headings. Important Note: Word’s caption tool, which inserts table titles and figure captions, will automatically number new tables and figures as you add titles and captions (e.g., Table 1, Table 2, Table 3).
  • how to create table of contents in word 2010 automatically

    Note To help prevent potentially dangerous code from running, we recommend that you return to any one of the settings that disable all macros after you finish working with macros.Īnd now you can run the code that creates the table of contents worksheet!

  • Under Macro Settings, click Enable all macros (not recommended, potentially dangerous code can run), and then click OK.
  • On the Developer tab, in the Code group, click Macro Security.
  • To set the security level temporarily to enable all macros, do the following: You might need to change your macro security settings to enable macros.
  • On the File menu, click Save As, and then save the file as an Excel Macro-Enabled Workbook (.xlsm).
  • In the Visual Basic Editor, on the File menu, click Close and Return to Microsoft Excel.
  • Now, save your workbook with the macro code. WsActive.Columns(“A:B”).EntireColumn.AutoFit Cells(lnRow, 2).Value = “‘” & lnCount & “-” & lnPages ‘of pages to be printed for each sheet on the TOC sheet. ‘sheetnames, add hyperlink and count & write the running number ‘Iterate through the worksheets in the workbook and create Value = VBA.Array(“Table of Contents”, “Sheet # – # of Pages”) ‘If the TOC sheet already exist delete it and add a new
  • In the code window of the module, type or copy the following macro code:.
  • In the Visual Basic Editor, on the Insert menu, click Module.
  • On the Developer tab, in the Code group, click Visual Basic.
  • how to create table of contents in word 2010 automatically

    Under Customize the Ribbon, select the Developer check box.If you don’t usually work with code in Excel, you probably don’t see the Developer tab in the Ribbon. First, you have to add the code to your workbook, and to do that you need the Developer tab.









    How to create table of contents in word 2010 automatically