Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
List Sheets excluding sheets named ***-A | Excel Discussion (Misc queries) | |||
Need to create a list of sheets from a list of names in column a | Excel Programming | |||
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? | Excel Worksheet Functions | |||
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? | Excel Programming | |||
Condensing a list/range with blank cells to a new list/range without blanks | Excel Worksheet Functions |