Named Ranges: Disable or alert/auto-display

MrSamExcel

Board Regular
Joined
Apr 6, 2016
Messages
50
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Is there a way I can disable creation of Named Ranges in a specific workbook for all users? I didn’t see anything in the Protect/Lock menus.
If not, is there a way to auto-alert if Named Ranges exist when the file is opened? Similar idea as the “Ask to update automatic links” prompt.
If not, is there a non-VBA formula I can leave in a worksheet that will populate all/any Named Ranges that exist in the workbook? Similar to using Formulas menu > Use in Formula > Paste Names, but an approach that populates automatically without user clicks required.
Thanks.
 

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".
In my version, if a protected sheet is active, creation of new named ranges is disabled. Even if all cells are unlocked, this is true when the sheet is protected. So one solution is to protect all the worksheets in the file, leaving all cells unlocked that you want to allow the user to change.

There is no non-VBA way to list defined names automatically.
 
Upvote 0
Solution
In my version, if a protected sheet is active, creation of new named ranges is disabled. Even if all cells are unlocked, this is true when the sheet is protected. So one solution is to protect all the worksheets in the file, leaving all cells unlocked that you want to allow the user to change.

There is no non-VBA way to list defined names automatically.
I can make that work in this case, thanks for your suggestion!
So the Protect Workbook function does not disable Named Ranges but the Protect Sheet function does. The Protect Sheet function cannot be applied to more than one sheet at a time (though could be achieved with a macro). I have 60 sheets so it will be a bit tedious, but it's only a one-time setup so this is still a reasonable solution. If I had to repeat the process frequently, or if the workbook had several more tabs, I'd have to rely on VBA.
 
Upvote 0
Protecting all the sheets with a macro is trivial and the code could be in a different file so your file would not have to be macro-enabled.
VBA Code:
Dim WS As Worksheet

For Each WS In ActiveWorkbook
   WS.Protect
Next WS
You could do the same kind of thing to get a list of named ranges.
 
Upvote 0

Forum statistics

Threads
1,215,091
Messages
6,123,062
Members
449,089
Latest member
ikke

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