Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Janet Panighetti
 
Posts: n/a
Default reference current worksheet name (tab name) in a formula

How may I reference the current worksheet name (the name on the tab) in a
formula on that worksheet.

In other words, I want to compare the string in a cell to the name of the
current worksheet. If it matches then I want to raise an error.

Thanks in advance!

Janet

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Trevor Shuttleworth
 
Posts: n/a
Default reference current worksheet name (tab name) in a formula

Janet

courtesy of:

www.ozgrid.com http://www.ozgrid.com/VBA/return-sheet-name.htm
Return an Excel Worksheet Name to a Cell

In Excel it is possible to use the CELL function/formula and the MID and
FIND to return the name of an Excel Worksheet in a Workbook. The formula
below shows us how;

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

Where A1 is any non error cell on the Worksheet. If you want the full path
of the Excel Workbook, simply use;

=CELL("filename",A1)

It is important to note that the above formulas will only work in a Workbook
that has been saved.

Search Google for: cell worksheet name excel for other references

Regards

Trevor


"Janet Panighetti" wrote in
message ...
How may I reference the current worksheet name (the name on the tab) in a
formula on that worksheet.

In other words, I want to compare the string in a cell to the name of the
current worksheet. If it matches then I want to raise an error.

Thanks in advance!

Janet



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Janet Panighetti
 
Posts: n/a
Default reference current worksheet name (tab name) in a formula

Very cool, Trevor!

Since all the worksheet names are a 6 digit number, I modified your
suggestion to the following:

=RIGHT(CELL("FILENAME",A1),6)

and it works GREAT!!!!!!!!!!!!!! I'll just have to remember to save the
workbook to get the new tabnames.

Thanks!!!!!!!!!!

Janet


"Trevor Shuttleworth" wrote:

Janet

courtesy of:

www.ozgrid.com http://www.ozgrid.com/VBA/return-sheet-name.htm
Return an Excel Worksheet Name to a Cell

In Excel it is possible to use the CELL function/formula and the MID and
FIND to return the name of an Excel Worksheet in a Workbook. The formula
below shows us how;

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

Where A1 is any non error cell on the Worksheet. If you want the full path
of the Excel Workbook, simply use;

=CELL("filename",A1)

It is important to note that the above formulas will only work in a Workbook
that has been saved.

Search Google for: cell worksheet name excel for other references

Regards

Trevor


"Janet Panighetti" wrote in
message ...
How may I reference the current worksheet name (the name on the tab) in a
formula on that worksheet.

In other words, I want to compare the string in a cell to the name of the
current worksheet. If it matches then I want to raise an error.

Thanks in advance!

Janet




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Trevor Shuttleworth
 
Posts: n/a
Default reference current worksheet name (tab name) in a formula

Janet

you're very welcome. Thanks for the feedback. As I said, credit to OZGRID
for this solution, although you'll find it in lots of other places.

Regards

Trevor


"Janet Panighetti" wrote in
message ...
Very cool, Trevor!

Since all the worksheet names are a 6 digit number, I modified your
suggestion to the following:

=RIGHT(CELL("FILENAME",A1),6)

and it works GREAT!!!!!!!!!!!!!! I'll just have to remember to save the
workbook to get the new tabnames.

Thanks!!!!!!!!!!

Janet


"Trevor Shuttleworth" wrote:

Janet

courtesy of:

www.ozgrid.com http://www.ozgrid.com/VBA/return-sheet-name.htm
Return an Excel Worksheet Name to a Cell

In Excel it is possible to use the CELL function/formula and the MID and
FIND to return the name of an Excel Worksheet in a Workbook. The formula
below shows us how;

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

Where A1 is any non error cell on the Worksheet. If you want the full
path
of the Excel Workbook, simply use;

=CELL("filename",A1)

It is important to note that the above formulas will only work in a
Workbook
that has been saved.

Search Google for: cell worksheet name excel for other references

Regards

Trevor


"Janet Panighetti" wrote in
message ...
How may I reference the current worksheet name (the name on the tab) in
a
formula on that worksheet.

In other words, I want to compare the string in a cell to the name of
the
current worksheet. If it matches then I want to raise an error.

Thanks in advance!

Janet






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A formula in this worksheet contains one or more invalid reference Barb Reinhardt Excel Discussion (Misc queries) 1 May 22nd 06 06:42 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 07:48 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 03:28 AM
Reference the worksheet from a multiple worksheet range function ( DBickel Excel Worksheet Functions 1 May 28th 05 03:49 AM
Indirect reference from one worksheet to another Bill Sturdevant Excel Worksheet Functions 2 December 17th 04 01:23 PM


All times are GMT +1. The time now is 03:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"