Formula to obtain worksheet's name?

ianccy

Active Member
Joined
Jul 28, 2002
Messages
332
I want to enter a formula to a cell so that it equals the name of the worksheet, anyone?

Thanks
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
On 2002-10-15 06:29, ianccy wrote:
I want to enter a formula to a cell so that it equals the name of the worksheet, anyone?

Thanks

In A1 enter:

=CELL("filename",Sheet1!A1)

In B1 enter:

=RIGHT(A1,LEN(A1)-SEARCH("@#",SUBSTITUTE(A1,"]","@#",LEN(A1)-LEN(SUBSTITUTE(A1,"]","")))))
 
Upvote 0
You can do it with a litthe bit of code in a macro

sub sheet ident()

' Select a target cell for the result

Range("R39").Select
ActiveCell = ThisWorkbook.Name


End Sub



Hope this helps.

Whoopee answered a Vba question

:) DaveA :) :wink:
 
Upvote 0
Or this, courtesy of Bill Manville.

=MID(CELL("filename",A2),FIND("]",CELL("filename",A2))+1,255)
 
Upvote 0
On 2002-10-15 07:16, dk wrote:
Or this, courtesy of Bill Manville.

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

If you installed the morefunc.xll add-in, we can make it shorter & more efficient:

=WMID(CELL("filename",A1),-1,1,"]")

or just

=SHEETNAME() :biggrin:

Aladin
This message was edited by Aladin Akyurek on 2002-10-15 07:48
 
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,283
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top