View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Arvi Laanemets Arvi Laanemets is offline
external usenet poster
 
Posts: 510
Default Extracting Worksheet names within a spreadsheet

Hi

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 )


"Sunny" wrote in message
...
Is it possible to extract the name of all the worksheets within a
spreadsheet.

On a monthly basis I have a spreadsheet that have a worksheets added. I
need to identify which worksheets are new.

In a nutshell I require a contents page on the first worksheeting listing
what all the worksheet names are with the spreadsheet.