(Name) vs. "Name"

roemun

New Member
Joined
Aug 6, 2009
Messages
23
Is there a way to refer to a worksheet in a formula by its (name) as opposed to its "name", (name) being what is shown as the sheet's first property in the properties window? Or maybe a function?
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
It sounds like you are refering to the CodeName property of a sheet.
If in the Project Explorer window shows "Sheet1 (SheetAlpha)" then
"Sheet1" is the CodeName of the sheet, "SheetAlpha" is the Name of the sheet (which is shown on the tab. Both of these message boxes will show the same result.
Code:
MsgBox Sheet1.Range("A1").Value
MsgBox Sheets("SheetAlpha").Range("A1").Value
 
Upvote 0
Can you give an example of the formula you want to use?

Generally, in Visual Basic macro code you have more options. But you might find Defined Names convenient in your worksheet formulas, depending on what your aim is.

Alex
 
Upvote 0
Sample formula:

='shtname'!$D89

where I want to substitute the codename for the sheet, e.g. Sheet1, in place of the user defined sheet name. in the above "shtname"
 
Upvote 0
You don't gain anything from this - Use the sheet names on the tab. That's what they are for ;) A UDF could be devised but you'd have inferior performance.
 
Upvote 0
What I am trying to "gain from this" is that I want the formula in that cell to remain effective regardless of what the tab name for the sheet might be. If there is code that would accomplish this, I would be happy to use it, or, as you suggest, a UDF. I am having difficulty devising one or the other of these.
 
Upvote 0
Try this.

Name a sheet Smith (or anything you want). Enter anything in A1.

On another sheet enter

=Smith!A1

Now change the name of sheet Smith. What happens?
 
Upvote 0
Right - Excel keeps everything up to snuff for you, no worries.
 
Upvote 0

Forum statistics

Threads
1,214,789
Messages
6,121,590
Members
449,039
Latest member
Arbind kumar

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