ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   how do I make a list of the names of worksheets in an excel workb (https://www.excelbanter.com/excel-discussion-misc-queries/108079-how-do-i-make-list-names-worksheets-excel-workb.html)

MaryB

how do I make a list of the names of worksheets in an excel workb
 


Peo Sjoblom

how do I make a list of the names of worksheets in an excel workb
 
One way

http://www.cpearson.com/excel/excelM.htm


at the bottom called sheet names, this is by using VBA, no built in function
for thus


--


Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
(Remove ^^ from email)


"MaryB" wrote in message
...




Arvi Laanemets

how do I make a list of the names of worksheets in an excel workb
 
Hi

Another option is an user defined function. The advantage is that whenever
you add a sheet, or change the order of them in workbook, the list is
corrected automatically. The disandvantage ... ok, less formulas is always a
possibility to be considered.

Create an UDF (Activate VBA editor pressing Alt+F11, insert a new module
when there is no one in your workbook, and copy the code below into it).

-----

Public Function TabI(TabIndex As Integer, Optional parVolatile As Date) As
String
TabI = Sheets(TabIndex).Name
End Function

-----

On sheet you want to have the list of sheets in, into cell A1 enter the
formula
=IF(ISERROR(TABI(ROW(),NOW())),"",TABI(ROW()))
, and copy it down for some number of rows.

In case you want a heading for sheets list in cell A1, enter the modified
formula into cell A2
=IF(ISERROR(TABI(ROW()-1,NOW())),"",TABI(ROW()-1))
, and again copy it down.


--
Arvi Laanemets
( My real mail address: arvi.laanemets<attarkon.ee )


"MaryB" wrote in message
...





All times are GMT +1. The time now is 04:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com