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
 

Some videos you may like

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
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,"]","")))))
 

applebyd

Active Member
Joined
May 27, 2002
Messages
348
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:
 

dk

MrExcel MVP
Joined
Feb 15, 2002
Messages
2,942
Or this, courtesy of Bill Manville.

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

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
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
 

Watch MrExcel Video

Forum statistics

Threads
1,122,841
Messages
5,598,390
Members
414,234
Latest member
grlevesq

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
Top