<code class="vb keyword">Sub</code> <code class="vb plain">CreateIndex()</code>
<code class="vb spaces"> </code><code class="vb keyword">Dim</code> <code class="vb plain">xAlerts </code><code class="vb keyword">As</code> <code class="vb keyword">Boolean</code>
<code class="vb spaces"> </code><code class="vb keyword">Dim</code> <code class="vb plain">I </code><code class="vb keyword">As</code> <code class="vb keyword">Long</code>
<code class="vb spaces"> </code><code class="vb keyword">Dim</code> <code class="vb plain">xShtSummary </code><code class="vb keyword">As</code> <code class="vb plain">Worksheet</code>
<code class="vb spaces"> </code><code class="vb keyword">Dim</code> <code class="vb plain">xSht </code><code class="vb keyword">As</code> <code class="vb keyword">Variant</code>
<code class="vb spaces"> </code><code class="vb plain">xAlerts = Application.DisplayAlerts</code>
<code class="vb spaces"> </code><code class="vb plain">Application.DisplayAlerts = </code><code class="vb keyword">False</code>
<code class="vb spaces"> </code><code class="vb keyword">On</code> <code class="vb keyword">Error</code> <code class="vb keyword">Resume</code> <code class="vb keyword">Next</code>
<code class="vb spaces"> </code><code class="vb plain">Sheets(</code><code class="vb string">"Summary"</code><code class="vb plain">).Delete</code>
<code class="vb spaces"> </code><code class="vb keyword">On</code> <code class="vb keyword">Error</code> <code class="vb keyword">GoTo</code> <code class="vb plain">0</code>
<code class="vb spaces"> </code><code class="vb keyword">Set</code> <code class="vb plain">xShtSummary = Sheets.Add(Sheets(1))</code>
<code class="vb spaces"> </code><code class="vb plain">xShtSummary.Name = </code><code class="vb string">"Summary"</code>
<code class="vb spaces"> </code><code class="vb plain">I = 1</code>
<code class="vb spaces"> </code><code class="vb plain">Cells(1, 1).Value = </code><code class="vb string">"INDEX"</code>
<code class="vb spaces"> </code><code class="vb keyword">For</code> <code class="vb keyword">Each</code> <code class="vb plain">xSht </code><code class="vb keyword">In</code> <code class="vb plain">ThisWorkbook.Sheets</code>
<code class="vb spaces"> </code><code class="vb keyword">If</code> <code class="vb plain">xSht.Name <> </code><code class="vb string">"Summary"</code> <code class="vb keyword">Then</code>
<code class="vb spaces"> </code><code class="vb plain">I = I + 1</code>
<code class="vb spaces"> </code><code class="vb plain">xShtSummary.Hyperlinks.Add Cells(I, 1), </code><code class="vb string">""</code><code class="vb plain">, </code><code class="vb string">"'"</code> <code class="vb plain">& xSht.Name & </code><code class="vb string">"'!A1"</code><code class="vb plain">, , xSht.Name</code>
<code class="vb spaces"> </code><code class="vb keyword">End</code> <code class="vb keyword">If</code>
<code class="vb spaces"> </code><code class="vb keyword">Next</code>
<code class="vb spaces"> </code><code class="vb plain">Application.DisplayAlerts = xAlerts</code>
<code class="vb keyword">End</code> <code class="vb keyword">Sub