Pages

Wednesday, February 15, 2012

table of content in macro

http://dmcritchie.mvps.org/excel/buildtoc.htm

Edit Macro in Excel

How to use:
Copy above code.
In Excel press Alt + F11 to enter the VBE.
Press Ctrl + R to show the Project Explorer.
Right-click desired file on left.
Choose Insert -Module.
Paste code into the right pane.
Press Alt + Q to close the VBE.
Save workbook before any other changes.
Press Alt + F8, select 'CreateTOC', press Run.

Test the code:
From an existing workbook, save first.
Press Alt + F8.
Choose 'CreateTOC'.
Press 'Run'.
TOC sheet will be the left-most sheet added in your workbook.

0 comments:

 

site weekly hits