Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
name of worksheet
Is there a VBA function to display on the first worksheet of the
workbook all the names of the worksheets the book contains and puts them in seperate rows? ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
name of worksheet
One way. Execute from the sheet where you want it.
Sub listsheets() x = 1 For Each Sh In Sheets Cells(x, 1).Value = Sh.Name x = x + 1 Next End Sub "bluebanker" wrote in message ... Is there a VBA function to display on the first worksheet of the workbook all the names of the worksheets the book contains and puts them in seperate rows? ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
name of worksheet
Take a look at David McRitchie's BuildTOC macro:
http://www.mvps.org/dmcritchie/excel/buildtoc.htm In article , bluebanker wrote: Is there a VBA function to display on the first worksheet of the workbook all the names of the worksheets the book contains and puts them in seperate rows? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
name of worksheet
Bluebanker
he code below will work. Place it in your personal.xls to run with any open workbook Sub showSheetNames() Dim sht As Object Dim shtNew As Worksheet Dim x As Integer On Error Resume Next With Application .ScreenUpdating = False .DisplayAlerts = False End With Set shtNew = ActiveWorkbook.Worksheets.Add shtNew.Name = "Sheet List" With shtNew.Range("A1:B1") .Value = Array("Sheet Name", "Type") .Font.Bold = True End With x = 2 For Each sht In ActiveWorkbook.Sheets If sht.Name < shtNew.Name Then shtNew.Range("A" & x & ":B" & x).Value = Array(sht.Name, shtTypeName(sht.Type)) x = x + 1 End If Next sht With shtNew .Columns.AutoFit End With With Application .ScreenUpdating = True .DisplayAlerts = True End With End Sub -- HTH Nick Hodge Southampton, England "bluebanker" wrote in message ... Is there a VBA function to display on the first worksheet of the workbook all the names of the worksheets the book contains and puts them in seperate rows? ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
automatically appending newly added data on worksheet to a master list worksheet | Links and Linking in Excel | |||
Unable to Insert Worksheet/Move and copy worksheet Excel 2003 | Excel Worksheet Functions | |||
plot graph from multiple worksheet as embedded chart object on every worksheet | Charts and Charting in Excel | |||
Upload multiple text files into 1 excel worksheet + put the filename as the first column in the worksheet | Excel Worksheet Functions | |||
Attaching a JET database to an Excel Worksheet OR storing large binary data in a worksheet | Excel Programming |