How to insert in cell A1 the name on the tab

andreascostas

Board Regular
Joined
Jan 11, 2011
Messages
150
Is there a way to insert the name on the tab of an excel sheet into cell A1
without having to type it every time?
 
This may be closer, but I'm still not 100% sure

Rich (BB code):
Function sheet_name(r As Range)
  Application.Volatile
  sheet_name = r.Parent.Name
End Function

It works in tests.


Although I also tried volatile in my previous tests and didn't update, that's why I decided to go to set activesheet.


Maybe it would be good if the OP told us what he wants the name of the sheet, that would serve to find the right solution.
 
Upvote 0

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Maybe it would be good if the OP told us what he wants the name of the sheet, that would serve to find the right solution.
It would be interesting to know, but whatever the reason, the formula solution will produce the correct result won't it? With the added advantage that it is not dependant on the user having macros enabled.

Further, presumably the OP will know whether it is even remotely possible that the unusual circumstance I outlined in post 11 could occur (or easily prevent by giving the file name a name longer than 31 characters) so the fairly simple formula in the original link supplied by Joe should suffice (or with the 31 modification :))
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,243
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