Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
1) In VB, how do I list all sheet names on one worksheet?
2) In VB, how do I list all sheets that start with a similar name (e.g., QTD) on one worksheet I'd really appreciate any and all help!!!! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Mary Agnes
try these for ideas: Sub ListWorksheets() Dim ws As Worksheet Dim i As Long For Each ws In Worksheets i = i + 1 Range("A" & i) = ws.Name Next ws End Sub Sub ListWorksheetsQTD() Dim ws As Worksheet Dim i As Long For Each ws In Worksheets If UCase(Left(ws.Name, 3)) = "QTD" Then i = i + 1 Range("A" & i) = ws.Name End If Next ws End Sub Regards Trevor "Mary Agnes" wrote in message ... 1) In VB, how do I list all sheet names on one worksheet? 2) In VB, how do I list all sheets that start with a similar name (e.g., QTD) on one worksheet? I'd really appreciate any and all help!!!! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Mary,
Workbooks contain worksheets. Sub test() Dim wks As Worksheet, i As Long i = 1 For Each wks In Worksheets Sheet1.Cells(i, 1).Value = wks.Name i = i + 1 Next End Sub -- Rob van Gelder - http://www.vangelder.co.nz/excel "Mary Agnes" wrote in message ... 1) In VB, how do I list all sheet names on one worksheet? 2) In VB, how do I list all sheets that start with a similar name (e.g., QTD) on one worksheet? I'd really appreciate any and all help!!!! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Trevor & Rob:
Thanks so much for your help! I was able to combine both solutions into my program and it was EXACTLY what I was looking for. Can you recommend a good reference book for using VB 6.0? Thanks, Mary Agnes :) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sheet Referencing - autofilling sheet names | Excel Worksheet Functions | |||
Referencing Cells on Another Sheet | Excel Worksheet Functions | |||
Referencing every 5th cell in another sheet | Excel Worksheet Functions | |||
copy formula referencing sheet name to another sheet | Excel Worksheet Functions | |||
referencing a sheet named in a cell then using data from that sheet | Excel Worksheet Functions |