Placing the sheet's name in a cell

borolo222

New Member
Joined
Aug 18, 2009
Messages
42
Hi,

Is it possible to make a reference in a cell to the sheet's name?

I use a workbook with lots of sheets and i have to use their name inside the respective sheets.

thanks,

Emilio
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,484
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
 

ljungren13

Board Regular
Joined
Jun 4, 2010
Messages
195
Would something like this work?

Code:
Function SheetName()

   SheetName = ActiveSheet.Name

End Function
 

prabby25101981

Active Member
Joined
Jul 28, 2010
Messages
348
This is how you can pickup a sheet's name in a cell -

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

Then you can always use INDIRECT function along with concatenate or address to create a range and use it in the formula. Do you need help with that ?
 

borolo222

New Member
Joined
Aug 18, 2009
Messages
42

ADVERTISEMENT

Thanks for your quick response. I'll give them a shot.

Tried the three of them and all worked. don't understand how that formula works, can you explain it to me please?

thanks
 
Last edited:

ljungren13

Board Regular
Joined
Jun 4, 2010
Messages
195
Thanks for your quick response. I'll give them a shot.

Tried the three of them and all worked. don't understand how that formula works, can you explain it to me please?

thanks
=CELL("filename",A1)

tells you the "filename" of cell A1

ex:C:\Documents and Settings\User\My Documents\[Test.xls]Sheet1

the rest is just cropping that string to say just "Sheet1" by searching for "]"
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,914
Messages
5,834,351
Members
430,279
Latest member
mkasledge1

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