Formula in excel to give me the name of the following tab?

January 11, 2012 at 12:02:41
Specs: Windows Vista
I am looking for a formula for microsoft excel to output the name of the tab in a workbook that is immediately following the current tab that I am on. If I am on the last tab of my workbook, I understand that an error will be reached. Any help would be appreciated. Thanks.


See More: Formula in excel to give me the name of the following tab?

Report •


#1
January 11, 2012 at 15:50:57
As you may know tabs can have any name you wish, so determining the Last tab in a workbook is problematic.

Here is a formula that will return the Current sheet name:

=MID(CELL("filename"),FIND("]",CELL("filename"))+1,255)

Wrapping it in some kind of =IF() statement should work.

Curious why you cannot just look at the tab and see where you are?

MIKE

http://www.skeptic.com/


Report •

#2
January 11, 2012 at 20:36:22
Mike,

You might want to check your formula. Put it in a cell in Sheet1 to return Sheet1. Then put it in a cell in Sheet2 to return Sheet2. Then go back and look at the cell in Sheet1. Repeat for Sheet3.

If it works like it's working in my workbook, all cells with the formula will show the name of the last sheet it was executed in.

The formula which will return the name of the sheet in which it resides is:

=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,256)

BTW...both of the formulas will return #VALUE until the workbook is saved and the sheet recalculates.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#3
January 11, 2012 at 20:45:49
Check out the set of Functions offered at this site:

http://www.cpearson.com/excel/sheet...

There's one entitled:

Returning The Name Of The Next Worksheet

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

Related Solutions

#4
January 12, 2012 at 05:38:56
DerbyDad03,

You might want to check your formula.

I did mine on an sheet that had already been saved, and I just checked to make sure it returned the Sheet name.
I see now that you need the sheet to recalc, for the sheet name to change to the current sheet.

It was quick with no real checking.

I figured there was a VBA solution.

MIKE

http://www.skeptic.com/


Report •

#5
January 12, 2012 at 05:49:51
Mike

There may be a better way to do it than how I am doing it, but here is what I am trying to accomplish. I am working on a project that has many smaller projects within it. It could be up to one hundred smaller projects. Each smaller project will have its own dedicated tab with detailed information. I would like the first worksheet to be a summary page for the following individual project tabs. The tabs will be named arbitrarily, so I don't know what they will be named once they are created. My solution to this is to have a formula that determines what the name of the next tab is which would allow the summary page to use that name to look up the next tab, then the next tab, so on and so forth. The summary page would then automatically update whenever a new tab is added, or when tabs are updated with information. Hope this makes sense.


Report •

#6
January 12, 2012 at 07:00:24
atoups,

You will most definitely need the Macro's suggested by DerbyDad03.

See reply # 3

Sounds complicated, good luck.

MIKE

http://www.skeptic.com/


Report •


Ask Question