Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi There, Looking for VBA that will put into a new sheet a listing of all sheets in the current book... Thanks D *** Sent via Developersdex http://www.developersdex.com *** |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub ListSheets()
Dim i As Long On Error Resume Next Worksheets.Add.Name = "Sheet List" On Error GoTo 0 Worksheets("Sheet List").Cells.ClearContents For i = 1 To ActiveWorkbook.Worksheets.Count Cells(i, "A").Value = Worksheets(i).Name Next i Columns(1).AutoFit End Sub -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Darin Kramer" wrote in message ... Hi There, Looking for VBA that will put into a new sheet a listing of all sheets in the current book... Thanks D *** Sent via Developersdex http://www.developersdex.com *** |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Option Explicit
Sub GetSheets() Dim ws As Worksheet Dim wsResult As Worksheet Set wsResult = Worksheets.Add wsResult.Name = "Result" wsResult.Range("A1") = "Sheets" For Each ws In ThisWorkbook.Worksheets If ws.Name < "Result" Then wsResult.Range("A65000").End(xlUp).Offset(1) = ws.Name End If Next End Sub "Darin Kramer" wrote: Hi There, Looking for VBA that will put into a new sheet a listing of all sheets in the current book... Thanks D *** Sent via Developersdex http://www.developersdex.com *** |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Darin,
Try this. Change "ThisWorkbook" to "ActiveWorkbook" if the code is not going to be placed in the workbook you want the results in. Sub ListWorksheetNames() Dim wksTarget As Worksheet 'Change worksheet name to desired target sheet Set wksTarget = ThisWorkbook.Worksheets("Sheet1") For x = 1 To ThisWorkbook.Worksheets.Count 'Change Cells reference (Row, Column) to desired target cells wksTarget.Cells(x, 1).Value = ThisWorkbook.Worksheets(x).Name Next x End Sub Best regards John "Darin Kramer" wrote in message ... Hi There, Looking for VBA that will put into a new sheet a listing of all sheets in the current book... Thanks D *** Sent via Developersdex http://www.developersdex.com *** |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() This works great - however, I have a similar problem, but I have a worksheet with multiple graphs in it. Can the code be amended so that it will also list the graph names, Thanks very much Hywel -- Hywel ------------------------------------------------------------------------ Hywel's Profile: http://www.excelforum.com/member.php...o&userid=14824 View this thread: http://www.excelforum.com/showthread...hreadid=476738 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Ranking Question Listing Same Sheet! | Excel Discussion (Misc queries) | |||
pulling data from one sheet and listing selected data in another | Excel Worksheet Functions | |||
Listing of Sheet names | Excel Worksheet Functions | |||
listing sheet tabs | Excel Programming | |||
Listing External Worksheet references to your sheet | Excel Programming |