Display actual sheetname in a cell not the rename sheetname

vandango05

Board Regular
Joined
Oct 6, 2008
Messages
110
Hi all.

I wonder if someone can help me to display the actual sheetname in a cell rather than what you rename it to?

For example Sheet 195 - renamed to "Master Blank Sheet". I would like to display Sheet195 in a cell not "Master Blank Sheet"

See attached screenshot.

Thanks in advance!
 

Attachments

  • screenshot.jpg
    screenshot.jpg
    12.8 KB · Views: 1

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Something like
VBA Code:
ws1.Range("A1").Value = ws1.Codename
Where ws1 is a variable that refers to the sheet.
 
Upvote 0
That was just an example as it is not clear from your post exactly what is expected in terms of how you intend to identify which sheet to take the name from, or where the name should be entered.

There is no formula that will do what you want, it will need to be done in vba.
 
Upvote 0
Sorry I wasn't clear, I know where is no formula to display the codename only the worksheet name. On each worksheet id like to display the codename of the specific sheet in cell A1.
 
Upvote 0
How about
VBA Code:
Sub vandango()
   Dim Ws As Worksheet
   
   For Each Ws In Worksheets
      Ws.Range("A1").Value = Ws.CodeName
   Next Ws
End Sub
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,632
Messages
6,120,649
Members
448,975
Latest member
sweeberry

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