Hidden named ranges

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,924
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

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
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,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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