How to get name of sheet

P

Peter

Hello,

I need to use the worksheets name in a calculation, but I found no way
to get the worksheets name. Does anyone has a glue how to obtain it.

Thanx

Peter

PS. Sorry for the empty posting, I sent before
 
C

Chip Pearson

Peter,

Try the following formula:
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,99)

The workbook must have been saved for this formula to work
properly.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
P

Peter

This almost solves my problem, but not completely. This is because
this formula always evaluates to the currently opened sheet, but what
I need is the following: On each sheet I need the name of this sheet
itself. E.g. on sheet ONE the formula must alway return ONE,
independant from the currently selected sheet!

One way:

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

Peter said:
I need to use the worksheets name in a calculation, but I found no way
to get the worksheets name. Does anyone has a glue how to obtain it.
 
H

Harlan Grove

This almost solves my problem, but not completely. This is because
this formula always evaluates to the currently opened sheet, but what
I need is the following: On each sheet I need the name of this sheet
itself. E.g. on sheet ONE the formula must alway return ONE,
independant from the currently selected sheet!

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

J.E.'s formula works for me. Did you delete the ',A1' bits believing them to be
unnecessary? If so, that's your problem.
 
P

Peter

I really forgot to include the A1 parameter. After including it,
everything nows works as expected.

Thank you again.

Peter


This almost solves my problem, but not completely. This is because
this formula always evaluates to the currently opened sheet, but what
I need is the following: On each sheet I need the name of this sheet
itself. E.g. on sheet ONE the formula must alway return ONE,
independant from the currently selected sheet!

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

J.E.'s formula works for me. Did you delete the ',A1' bits believing them to be
unnecessary? If so, that's your problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top