Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hello,
Looking for some code that will return the names of all worksheets present in the workbook. The number of sheets and their names change... Help?! |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Sub allsheet()
Dim w As Worksheet For Each w In ActiveWorkbook.Worksheets MsgBox (w.Name) Next End Sub -- Gary's Student "JEFF" wrote: Hello, Looking for some code that will return the names of all worksheets present in the workbook. The number of sheets and their names change... Help?! |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Sorry.... Looking for it to list them in a column within Sheet 1, starting
in A1 "Gary''s Student" wrote: Sub allsheet() Dim w As Worksheet For Each w In ActiveWorkbook.Worksheets MsgBox (w.Name) Next End Sub -- Gary's Student "JEFF" wrote: Hello, Looking for some code that will return the names of all worksheets present in the workbook. The number of sheets and their names change... Help?! |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Jeff
Sub ListSheets() 'list of sheet names starting at A1 Dim rng As Range Dim i As Integer Set rng = Sheets("Sheet1").Range("A1") For Each Sheet In ActiveWorkbook.Sheets rng.Offset(i, 0).Value = Sheet.Name i = i + 1 Next Sheet End Sub Gord Dibben MS Excel MVP On Thu, 9 Nov 2006 10:47:02 -0800, JEFF wrote: Sorry.... Looking for it to list them in a column within Sheet 1, starting in A1 "Gary''s Student" wrote: Sub allsheet() Dim w As Worksheet For Each w In ActiveWorkbook.Worksheets MsgBox (w.Name) Next End Sub -- Gary's Student "JEFF" wrote: Hello, Looking for some code that will return the names of all worksheets present in the workbook. The number of sheets and their names change... Help?! |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
No problem:
Sub allsheet() Dim w As Worksheet i = 1 For Each w In ActiveWorkbook.Worksheets Sheets("Sheet1").Cells(i, "A").Value = w.Name i = i + 1 Next End Sub -- Gary's Student "JEFF" wrote: Sorry.... Looking for it to list them in a column within Sheet 1, starting in A1 "Gary''s Student" wrote: Sub allsheet() Dim w As Worksheet For Each w In ActiveWorkbook.Worksheets MsgBox (w.Name) Next End Sub -- Gary's Student "JEFF" wrote: Hello, Looking for some code that will return the names of all worksheets present in the workbook. The number of sheets and their names change... Help?! |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
that works... thanks!
"Gary''s Student" wrote: No problem: Sub allsheet() Dim w As Worksheet i = 1 For Each w In ActiveWorkbook.Worksheets Sheets("Sheet1").Cells(i, "A").Value = w.Name i = i + 1 Next End Sub -- Gary's Student "JEFF" wrote: Sorry.... Looking for it to list them in a column within Sheet 1, starting in A1 "Gary''s Student" wrote: Sub allsheet() Dim w As Worksheet For Each w In ActiveWorkbook.Worksheets MsgBox (w.Name) Next End Sub -- Gary's Student "JEFF" wrote: Hello, Looking for some code that will return the names of all worksheets present in the workbook. The number of sheets and their names change... Help?! |
#7
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Perfect.... thank you
"Gord Dibben" wrote: Jeff Sub ListSheets() 'list of sheet names starting at A1 Dim rng As Range Dim i As Integer Set rng = Sheets("Sheet1").Range("A1") For Each Sheet In ActiveWorkbook.Sheets rng.Offset(i, 0).Value = Sheet.Name i = i + 1 Next Sheet End Sub Gord Dibben MS Excel MVP On Thu, 9 Nov 2006 10:47:02 -0800, JEFF wrote: Sorry.... Looking for it to list them in a column within Sheet 1, starting in A1 "Gary''s Student" wrote: Sub allsheet() Dim w As Worksheet For Each w In ActiveWorkbook.Worksheets MsgBox (w.Name) Next End Sub -- Gary's Student "JEFF" wrote: Hello, Looking for some code that will return the names of all worksheets present in the workbook. The number of sheets and their names change... Help?! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Data Validation for list in a different workbook | Excel Discussion (Misc queries) | |||
Creating a List | Excel Discussion (Misc queries) | |||
auto updating list | Excel Worksheet Functions | |||
Getting Sheets Copied From One Workbook to Another Without ....? | New Users to Excel | |||
Dropdown list connected to another workbook | Excel Worksheet Functions |