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?
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?
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
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.
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
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:
Used in a cell as =SheetNum()![]()
Please Login or Register to view this content.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon 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!)
Or this, a tiny bit simpler:
![]()
Please Login or Register to view this content.
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.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks