+ Reply to Thread
Results 1 to 7 of 7

Return Sheet Number in a Cell

  1. #1
    Registered User
    Join Date
    08-17-2013
    Location
    South Carolina
    MS-Off Ver
    Excel 2016
    Posts
    19

    Return Sheet Number in a Cell

    I have a series of sheets and I need to be able to reorder them and have it display the number in the upper right hand corner. Not the page number but the sheet number. How is this done?

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Return Sheet Number in a Cell

    So are the tabs labeled sheet1,sheet2, ....? When you say you want to reorder them, does that mean you will move sheetx to be the first sheet and then you want it to say 1 in the cell even though the tab says "x"?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    08-17-2013
    Location
    South Carolina
    MS-Off Ver
    Excel 2016
    Posts
    19

    Re: Return Sheet Number in a Cell

    The sheets are named different things depending on what is on the sheet. I know how to display the sheet name. I want to display the sequence of the sheet within the workbook. So the 2nd sheet is labeled "2" and the 10th is "10". If a sheet is moved around it will automatically revise the sequence of all sheets.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,420

    Re: Return Sheet Number in a Cell

    Maybe:

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Return Sheet Number in a Cell

    TMS, if that were to be entered into cells on multiple sheets, all the sheets would be displaying the index of the currently activesheet, even the sheets not onscreen.

    I would recommend this approach so the result is tied to the sheet where the function is entered:

    Please Login or Register  to view this content.
    Used in a cell as =SheetNum()
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Return Sheet Number in a Cell

    Or this, a tiny bit simpler:
    Please Login or Register  to view this content.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Return Sheet Number in a Cell

    If you're using Excel 2013 enter this formula in some cell:

    =SHEET()

    Here's another option that will work in other versions of Excel.

    1. Create a defined name and call it SheetNum.
    2. In the refers to box type:

    =GET.DOCUMENT(87)+NOW()*0

    3. Back in the sheet in a cell type:

    =SheetNum

    which will return the index number of the sheet.

    In Excel 2007 and later you'll have to save the file as a macro enabled file in the *.xlsm file format.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Return comment to master sheet after matching to source sheet name and cell number
    By jeffreybrown in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-21-2012, 05:09 PM
  2. Replies: 2
    Last Post: 03-09-2011, 12:18 PM
  3. Replies: 5
    Last Post: 03-12-2010, 07:33 PM
  4. Return number of current sheet
    By Brandon in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-26-2005, 01:06 AM
  5. [SOLVED] Return Activecell row number from another sheet
    By quartz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-14-2005, 06:06 PM

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.6.0 RC 1