MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Table of Contents for worksheets


Posted by Debs on June 01, 2000 7:32 AM

Does anyone know how to add a "short" Table of Contents code page onto my existing sort Macro.

My code for sorting worksheets is:

Dim cnt As Integer
Dim n As Integer
Dim m As Integer

On Error GoTo endofmacro
cnt = ActiveWorkbook.Worksheets.Count
For m = 1 To cnt
For n = m To cnt
If UCase(Worksheets(n).Name) < UCase(Worksheets(m).Name) Then
Worksheets(n).Move before:=Worksheets(m)
End If
Next n
Next m
endofmacro:


End Sub

If possible a macro code that doesn't go into a printpreview mode that needs manual intervention to close it.

Thanking you in advance,

Debs


Posted by Ivan Moala on June 01, 0100 3:35 PM

Have a look @ Davids excellent site

http://members.aol.com/rexx03/excel/buildtoc.htm


HTH
Ivan