Dynamic name for a range

ChristineJ

Well-known Member
Joined
May 18, 2009
Messages
756
Office Version
  1. 365
Platform
  1. Windows
Is there a way to make the name of a named range = the worksheet name, and dynamic so that if the worksheet name changes, the name of the named ranges changes as well?

I know I can use =MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255) to get the sheet name in a cell and can use that to "Create from Selection" under "Defined Names" on the ribbon. But that only works to name the range the first time; it is not dynamic.

It would be preferable if this could be done without VBA. Thanks
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
It would be preferable if this could be done without VBA.
You wouldn't be able to do it without vba.
Even with vba, the idea seems a bit far fetched. The only way to do it would be with a calculate event to create a name based on the result of the formula if one does not already exist.
Deleting the old name could lead to problems. If there are no other named ranges in the workbook then brute force deleting of any named range that is not equal to a sheet name might work, other than that there is too much risk of deleting the wrong names to make the idea practical.
 
Upvote 0
Solution
You wouldn't be able to do it without vba.
Even with vba, the idea seems a bit far fetched. The only way to do it would be with a calculate event to create a name based on the result of the formula if one does not already exist.
Deleting the old name could lead to problems. If there are no other named ranges in the workbook then brute force deleting of any named range that is not equal to a sheet name might work, other than that there is too much risk of deleting the wrong names to make the idea practical.
Thanks for the reply and the explanation. I will take your advice and try an alternative to what I was trying to accomplish. Appreciate it.
 
Upvote 0
I will take your advice and try an alternative to what I was trying to accomplish.
What is the logic behind the original idea?
Or more specifically, what were you intending to use the name for once it is set up?
 
Upvote 0

Forum statistics

Threads
1,212,927
Messages
6,110,730
Members
448,294
Latest member
jmjmjmjmjmjm

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