+ Reply to Thread
Results 1 to 17 of 17

Why can't i change scope of named range within name manager?

  1. #1
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Why can't i change scope of named range within name manager?

    Hi Guys,

    i have bunch of variables with different scopes.

    But my name manager doesnt allow me to change it:

    scope.PNG

    why is that?

    Where can i set up scopes for all variables?

    Best,
    Jacek

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Why can't i change scope of named range within name manager?

    You have to delete the old name and recreate it with the required new scope.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Why can't i change scope of named range within name manager?

    Aa ok thank you!

    So it is no possible to change a scope for already created variables...

    Jacek

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Why can't i change scope of named range within name manager?

    No, not directly. If I remember correctly, the Name Manager tool from Jan Karel Pieterse/Charles Williams does allow that, though I suspect it simply does the delete and recreate for you.

  5. #5
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Why can't i change scope of named range within name manager?

    ok thank you !

    Jacek

  6. #6
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Why can't i change scope of named range within name manager?

    I did some searching on this subject a couple of years ago because I needed to change some names on a file at work where no add-ins are possible. I found some code which worked for me - but please check it on a copy of your file before using it on your actual file. It should change all names which are only worksheet-scope to workbook-scope.
    Please Login or Register  to view this content.
    Hope that helps.

    Edit: note that there's no error checking in this macro. If there are two worksheet-scope Names with the same name, I don't know what the result will be.
    Last edited by Aardigspook; 02-06-2018 at 02:42 PM. Reason: Add note about error checking
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  7. #7
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Why can't i change scope of named range within name manager?

    Thank you Aardigpook ,

    your macro can be useful for others!

    Jacek

  8. #8
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: Why can't i change scope of named range within name manager?

    Just to point out this is intentional by MS.

    Named ranges have to have unique names, within their scope. This means you can have a named range called "MyRange" with a scope of Workbook and another named range with the same name with a scope of Sheet1, but you cannot have 2x workbook scope with the same name or 2x Sheet1 with the same name.

    Ok, easy enough Excel should just check if the name you try and rename it to already exists. Sure they could but...

    The scope of a named range would likely impact the refers to as well, at least in terms of what you would want it to refer to. Excel cant really check if it refers to what you want it to.

    Lastly, copy/paste. Its possible to duplicate named ranges without even knowing you have using copy/paste. I believe the scope changes when this happens (at least for workbook scope named ranges, they get copied as sheet level) to prevent them from completely breaking.

    With all the above allowing people to rename could be a mess. As pointed out, either recreating them or using a macro/3rd party solution should work.
    Ways to get help: Post clear questions, explain your overall goal, supply as much background as possible, respond to questions asked of you by those trying to help and post sample(s) files.

    "I am here to help, not do it for people" -Me

  9. #9
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Why can't i change scope of named range within name manager?

    Quote Originally Posted by Zer0Cool View Post
    ...Excel should just check if the name you try and rename it to already exists...
    I should point out that the macro I posted above doesn't have any error-checking in it and I don't know what will happen if you have two worksheet-names with the same name. So, as I implied above, test on a back-up copy first!

  10. #10
    Registered User
    Join Date
    12-14-2020
    Location
    Canada
    MS-Off Ver
    2019
    Posts
    1

    Re: Why can't i change scope of named range within name manager?

    Yes, it may be intentional but it is stupid. Somehow, a bunch of my named ranges got converted from Workbook scope to Worksheet scope, probably because I created a copy of the sheet defining them. And now it won't let me redo the scope. I want to delete one and change the other to workbook scope. Seems like a completely reasonable thing to do. But instead, I have to delete both of them and recreate one of them as Workbook scope. Typical stupid microsoft BS! Software that is "just good enough".

  11. #11
    Registered User
    Join Date
    11-30-2012
    Location
    Denver, CO
    MS-Off Ver
    Excel 2013
    Posts
    1

    Re: Why can't i change scope of named range within name manager?

    Well that worked swimmingly! Thank you!

  12. #12
    Registered User
    Join Date
    07-25-2014
    Location
    Ireland
    MS-Off Ver
    2010
    Posts
    2

    Re: Why can't i change scope of named range within name manager?

    Hi Aardigspook,

    Thank you so much for your code. It worked like a dream.

    All the best
    Ekki

  13. #13
    Registered User
    Join Date
    04-05-2021
    Location
    Kansas,USA
    MS-Off Ver
    2016
    Posts
    1

    Re: Why can't i change scope of named range within name manager?

    Aardigspook
    You are a life saver!
    I Sincerely Thank you
    greed98

  14. #14
    Registered User
    Join Date
    12-01-2023
    Location
    Canada
    MS-Off Ver
    Excel 365 (Ver 2309)
    Posts
    1

    Re: Why can't i change scope of named range within name manager?

    Hi, I am new to the forum. Thank you for the macro! I installed the macro in my Excel Personal file and ran it. I did not get an error message but the scopes of my formula names were unchanged. What am I missing? Is there a requirement that the macro run from the workbook that has the issue? Any help you can offer is appreciated. Thank you
    Last edited by ericgpe; 12-01-2023 at 04:22 PM.

  15. #15
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Why can't i change scope of named range within name manager?

    Hi ericgpe,
    Yes, you need to run the macro from the workbook which you want to change. To do this, open the Visual Basic editor (press Alt-F11), make sure you select the correct workbook on the left-hand side, insert a new module, copy/paste the code, then run it. After it's run, you can save the workbook as a normal .xlsx file and the macro will be deleted (you'll get a warning dialogue box about this) or save it as a macro-enabled .xlsm file and it'll be kept.
    Hope that helps.
    AS

  16. #16
    Registered User
    Join Date
    01-21-2024
    Location
    Taiwan, Tainan
    MS-Off Ver
    MS Office 365
    Posts
    1

    Re: Why can't i change scope of named range within name manager?

    Hi Aardigspook,

    How are you? This code works for me, thanks.

  17. #17
    Registered User
    Join Date
    01-24-2024
    Location
    Perth, Australia
    MS-Off Ver
    MS 365
    Posts
    1

    Re: Why can't i change scope of named range within name manager?

    This was possible (and easy) in Excel versions up to 2003. Yet another useful feature that Microsoft decided to remove.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Named Range- 'refers to' defined in a cell instead of in the Name Manager
    By MycroftHolmes in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-21-2017, 10:18 AM
  2. [SOLVED] Scope of Named Range
    By andrewc in forum Excel General
    Replies: 2
    Last Post: 12-04-2013, 09:52 AM
  3. Replies: 0
    Last Post: 09-30-2013, 01:02 PM
  4. [SOLVED] Named Range Scope
    By OzTrekker in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-12-2012, 02:22 AM
  5. Named Ranges - Worksheet/Workbook Scope
    By keithabailey in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-17-2011, 10:25 AM
  6. Dynamic named ranges with entire workbook scope
    By jeffreybrown in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-29-2011, 10:16 AM
  7. Named range scope
    By natefarm in forum Excel General
    Replies: 2
    Last Post: 05-13-2011, 05:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1