Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default list sheets in range

hi.


i have a code which i need to ammend.
I need to only list sheet names in between sheets named "start" &
"End".
I need the list to start in cell a22 on sheet "apples"



Sub listsheets()
For i = 1 To Worksheets.Count
Cells(i, "a") = Sheets(i).Name
Next i
End Sub



thanx

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default list sheets in range

Sub listsheets()
Dim i As Long, sh As Worksheet
Dim bWrite As Boolean
bWrite = False
i = 22
For Each sh In Worksheets
If bWrite Then
If LCase(sh.Name) < "end" Then
Worksheets("apples").Cells(i, "a").Value = sh.Name
i = i + 1
Else
bWrite = False
End If
End If
If LCase(sh.Name) = "start" Then
bWrite = True
End If
Next sh

End Sub

worked for me.

--
Regards,
Tom Ogilvy


"J.W. Aldridge" wrote:

hi.


i have a code which i need to ammend.
I need to only list sheet names in between sheets named "start" &
"End".
I need the list to start in cell a22 on sheet "apples"



Sub listsheets()
For i = 1 To Worksheets.Count
Cells(i, "a") = Sheets(i).Name
Next i
End Sub



thanx


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
List Sheets excluding sheets named ***-A Dolphinv4 Excel Discussion (Misc queries) 1 December 15th 07 09:29 AM
Need to create a list of sheets from a list of names in column a KC Rippstein Excel Programming 0 December 7th 06 08:15 PM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Worksheet Functions 6 March 29th 06 12:43 PM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Programming 6 March 29th 06 12:43 PM
Condensing a list/range with blank cells to a new list/range without blanks KR Excel Worksheet Functions 4 July 5th 05 04:23 PM


All times are GMT +1. The time now is 09:27 AM.

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

About Us

"It's about Microsoft Excel"