Hidden named ranges

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,926
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I have created a named range called MyNamedRange (scope Sheet1) referring to cell A1 of Sheet1.

Then I hid all named ranges as follows:

Code:
    Dim nm As Name
    
    For Each nm In ThisWorkbook.Names
        
        nm.Visible = False
    
    Next nm

To my surprise, I can now create another named range also called MyNamedRange (scope Sheet1) referring to cell E1.

When I unhid all named ranges, there is only ONE named range called MyNamedRange and it refers to cell E1.

Is this a bug?
 
Last edited:

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Seems to be a...um...."feature"
If the range name is visible....attempting to replicate it triggers an error: name already exists.
However, if the range name is hidden....attempting to replicate it simply redefines it.
(Odd behavior, certainly)
 
Upvote 0
Seems to be a...um...."feature"
If the range name is visible....attempting to replicate it triggers an error: name already exists.
However, if the range name is hidden....attempting to replicate it simply redefines it.
(Odd behavior, certainly)

Exactly, that's my point.

I think it's a design flaw because if you hide all named ranges (not wanting people to change or even know about them), another user might want to create a named range that already exists and thus will change what's there.
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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