+ Reply to Thread
Results 1 to 6 of 6

Extracting Worksheet names within a spreadsheet

  1. #1
    Sunny
    Guest

    Extracting Worksheet names within a spreadsheet

    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.



  2. #2
    Forum Contributor
    Join Date
    12-12-2005
    Posts
    667

    Extracting Worksheet names within a spreadsheet

    You would have to use VBE:
    Sub SheetList()
    For Each ws In Worksheets
    i = i + 1
    Cells(i, 1) = ws.Name
    Next
    End Sub
    Best regards,

    Ray

  3. #3
    Arvi Laanemets
    Guest

    Re: 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<at>tarkon.ee )


    "Sunny" <[email protected]> wrote in message
    news:[email protected]...
    > 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.
    >
    >




  4. #4
    Jim Cone
    Guest

    Re: Extracting Worksheet names within a spreadsheet

    The free Excel add-in "XL Extras" will do that.
    Plus it will sort the workbook sheets and do other stuff.
    Download from ... http://www.realezsites.com/bus/primitivesoftware
    No registration required.
    --
    Jim Cone
    San Francisco, USA


    "Sunny"
    <[email protected]>
    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.



  5. #5
    Sunny
    Guest

    RE: Extracting Worksheet names within a spreadsheet

    Thank you all for your responses.

    Much Appreciated

    "Sunny" wrote:

    > 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.
    >
    >


  6. #6
    Sunny
    Guest

    Re: Extracting Worksheet names within a spreadsheet

    This works. Exactly what I wanted.

    Thanks a lot saved a lot of hassle.

    Sunny

    "raypayette" wrote:

    >
    > You would have to use VBE:
    > Sub SheetList()
    > For Each ws In Worksheets
    > i = i + 1
    > Cells(i, 1) = ws.Name
    > Next
    > End Sub
    >
    >
    > --
    > raypayette
    >
    >
    > ------------------------------------------------------------------------
    > raypayette's Profile: http://www.excelforum.com/member.php...o&userid=29569
    > View this thread: http://www.excelforum.com/showthread...hreadid=566968
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1