Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Skip sheets while indexing

Hello,
Nevermind, I got it figured out. Or at least well enough to get by.
Thanks!
Melinda

Sub SheetNamesSortedDownRows()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim Rng As Range
Dim x As Long
Dim iRow As Long
iRow = 13
For x = 3 To ActiveWorkbook.Worksheets.Count
If ActiveWorkbook.Worksheets(x).Name < " " Then
iRow = iRow + 1
Cells(iRow, 3) = "'" & Left(Worksheets(x).Name, 9)
End If
Next x
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

"Melinda Chase" wrote in
message ...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Indexing Sheets in Referenced Workbook within formula tiazmos Excel Worksheet Functions 1 January 14th 10 07:13 PM
Skip Rows in Fill Series and Filter to Two different sheets Benjamin Excel Worksheet Functions 3 June 30th 09 12:58 AM
skip hidden sheets savalou Excel Programming 3 October 18th 05 08:54 PM
Sheets Skip Macro NICK Excel Discussion (Misc queries) 2 February 11th 05 07:16 AM
skip empty sheets Rob Excel Programming 2 February 6th 05 01:48 PM


All times are GMT +1. The time now is 10:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"