View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Melinda Chase Melinda Chase is offline
external usenet poster
 
Posts: 2
Default Skip sheets while indexing

Hello All,
I am trying to create an index of the sheets in my Excel file. I'm using
David McRitchie's code to create the index and all is working as it should.
What I would like to do is skip the first two sheets in the workbook when
indexing. How can I modify the below code to skip the first two sheets?
Thanks!
Melinda

Sub SheetNamesSortedDownRows()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim Rng As Range
Dim WS As Worksheet
Set Rng = Range("c14")
For Each WS In ActiveWorkbook.Worksheets
Rng.Value = "'" & WS.Name
Set Rng = Rng(2, 1)
Next WS
Cells.Sort Key1:=Range("c14"), Order1:=xlAscending, _
Header:=xlNo, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
Range("c14").Select
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub