+ Reply to Thread
Results 1 to 10 of 10

Thread: Formula to find workbook tab number

  1. #1
    Registered User
    Join Date
    12-18-2008
    Location
    Lubbock, TX
    MS-Off Ver
    Excel 2010
    Posts
    16

    Formula to find workbook tab number

    I am looking for a formula to place within each worksheet to identify the sequence number of that worksheet.

    For example, if I have a workbook containing four worksheets named "Start", "Alpha", "Beta", and "End" I want a formula within the "Alpha" worksheet that contains a workbook tab number of 2 since it is the second worksheet within the workbook.

    My preference is not to use VBA or a macro but I will accept any help.

    Thanks, Dell.
    Last edited by dellschipper; 10-05-2011 at 02:59 PM.

  2. #2
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Formula to find workbook tab number

    Make a list of all the worksheets in a column of any sheet.. then name that range by typing in the Name box to the left of the formula bar... e.g. TabNames.

    Then try:

    =MATCH(MID(CELL("filename",$A$1),FIND("]",CELL("filename",$A$1))+1,255),TabNames,0)
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    10-04-2011
    Location
    ---
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Formula to find workbook tab number

    what is the list of sheet is variable?

  4. #4
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Formula to find workbook tab number

    Insert the sheet name into the list at appropriate position.

    Please continue correspondence in your own thread.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  5. #5
    Registered User
    Join Date
    12-18-2008
    Location
    Lubbock, TX
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Formula to find workbook tab number

    Well, the number of worksheets is variable and my intent was to produce the table rather than start with the table. I was planning on using a SUMIF formula going from "Start:End" and matching the workbook tab number with a sequential list to populate the table.

  6. #6
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Formula to find workbook tab number

    I think if you will need VBA udf then...

    Perhaps...

    Function Sheetnum()
        For i = 1 To sheets.Count
            If ActiveSheet.Name = sheets(i).Name Then
            Sheetnum = i
            End If
        Next i
    End Function
    in any sheet type =Sheetnum() to get active sheetnumber
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  7. #7
    Valued Forum Contributor
    Join Date
    07-29-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    372

    Re: Formula to find workbook tab number

    Different approach based on the Named Formula "sheetnumber", wich in turn uses "GET.DOCUMENT(87)" .
    Attached Files Attached Files

  8. #8
    Forum Moderator arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    4,371

    Re: Formula to find workbook tab number

    What is Get.Document(87)?

  9. #9
    Registered User
    Join Date
    10-04-2011
    Location
    ---
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Formula to find workbook tab number

    Quote Originally Posted by arlu1201 View Post
    What is Get.Document(87)?
    I found description here:
    http://xcell05.free.fr/morefunc/engl...e.document.htm

  10. #10
    Registered User
    Join Date
    10-04-2011
    Location
    ---
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Formula to find workbook tab number

    Quote Originally Posted by WHER View Post
    Different approach based on the Named Formula "sheetnumber", wich in turn uses "GET.DOCUMENT(87)" .
    It looks very easy now.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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