Excel formula to find Sheet name in different worksheet :: MrExcel Message Board



 FAQFAQ
   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   StatisticsStatistics 
 RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Online StoreOnline Store

MrExcel Message Board Forum Index -> Excel Questions

formula to find Sheet name in different worksheet
Post new topic   Reply to topic
Last Thread | Next Thread  >   Printable version
  Author    Thread

SamS
Board Master


Joined: 18 Feb 2002
Posts: 374
Location: Brisbane, Down Under

Status: Offline

 Reply with quote  

Ivan (with greatful thanks) posted this formula recently which places the worksheet name into a cell which I have used more and more of late.

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

I have 2 variations I need to use.
1) I want the cell to reference a different worksheet (which is a department name), have tried a number of alternatives but am having no luck.
2) I then require another cell which is a formula (for use in a graph) to pick up this same reference ie replace the Network Program Delivery in ="Network Program Delivery'!$K$1 with the worksheet reference.

I know it seems to be a heavy handed way of doing things (and there probably is some simple way of doing it) but the way department names change regularily around here I only want to make one change and that is to the worksheet name.

Will be eternally gratefull if someone can supply the info icon_smile.gif
Edit: too early in the morning here-also off the coffee which probably explains it. Prob no2 is not a prob any more, will just rely on the formula automatically changing with the worksheet name change

[ This Message was edited by: SamS on 2002-05-21 15:49 ]

Post Tue May 21, 2002 7:15 pm 
 View user's profile Send private message Send e-mail

Jay Petrulis
MrExcel MVP


Joined: 18 Mar 2002
Posts: 1674
Location: Chicago, IL USA
Flag: Blank

Status: Offline

 Reply with quote  

Hi,

You would likely need a user-defined function (UDF) to do this, although I can't tell exactly what you are requesting.


Function test()
test = Application.Caller.Worksheet.Next.Name
End Function

Function test2()
test2 = ActiveSheet.Next.Name
End Function


These two functions should work for you, after modification. I think the top is a bit more stable. These just get the next sheet after the sheet where you place the formula.

Bye,
Jay

Post Wed May 22, 2002 1:00 am 
 View user's profile Send private message

SamS
Board Master


Joined: 18 Feb 2002
Posts: 374
Location: Brisbane, Down Under

Status: Offline

 Reply with quote  

Thanks Jay, will play around with this and see what comes up.

Post Wed May 22, 2002 3:50 am 
 View user's profile Send private message Send e-mail
  Display posts from previous:      

MrExcel Message Board Forum Index -> Excel Questions


Forum Jump:
Jump to:  

Post new topic   Reply to topic
Page 1 of 1



Add To Favorites

 


Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB: 2.0.4 © 2001 phpBB Group

Need help posting your first question? Read how to post

Need extra help ? Couldn't get the answer you needed ? Get a free quote from our Consulting Team

Download Colo's HTML Maker utility for displaying your Excel Worksheet on the board.

Download VB HTML Maker to post your code on the board


Check out our new index to 485 Excel Articles.


Return to MrExcel Consulting

All contents Copyright 1998-2004 by MrExcel.com
If you believe information posted here is from your copyrighted source, notify us per the Terms of Use
Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.