Need function to insert worksheet name into a cell of that worksheet.

A

August Meduna

I have found a formula on the web help site to
automatically insert a worksheet name into a cell of the
worksheet. I have several worksheets and wish to identify
each worksheet automatically in a cell of each worksheet.
When I use the formula it initially brings in the correct
worksheet name. However when I select another worksheet
the prior name appears in the selected cell.

Perhaps I need to change something in my formula or this
is a problem that I can't correct. What is your
suggestion?

The following formula is what I am using in each
worksheet.
=MID(CELL("filename"),SEARCH("[",CELL("filename"))
+18,SEARCH("]",CELL("filename"))-2 )

Perhaps there is a simpler way to insert the worksheet
name into a cell. Something like; =cell("worksheet"), or
=cell("filename,-path"). I haven't been able to find the
solution. Please advise.

Thanks
 
D

Dave Peterson

Try the response to this FAQ at Debra Dalgleish's site:
http://www.contextures.com/xlfaqFun.html#SheetName

Notice that the response includes a cell from the worksheet.

It's probably a good thing to add to your formula, too!

August said:
I have found a formula on the web help site to
automatically insert a worksheet name into a cell of the
worksheet. I have several worksheets and wish to identify
each worksheet automatically in a cell of each worksheet.
When I use the formula it initially brings in the correct
worksheet name. However when I select another worksheet
the prior name appears in the selected cell.

Perhaps I need to change something in my formula or this
is a problem that I can't correct. What is your
suggestion?

The following formula is what I am using in each
worksheet.
=MID(CELL("filename"),SEARCH("[",CELL("filename"))
+18,SEARCH("]",CELL("filename"))-2 )

Perhaps there is a simpler way to insert the worksheet
name into a cell. Something like; =cell("worksheet"), or
=cell("filename,-path"). I haven't been able to find the
solution. Please advise.

Thanks
 

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