Excel - RE-naming ranges in Name Manager - How to change the Scope

Posted on 2012-09-02
Last Modified: 2012-09-16
The scope is grayed out when I edit a named range.  How can I change the scope when editing a range? (See graphic)
Question by:brothertruffle880
    LVL 20

    Accepted Solution

    You cannot change the scope once the name is created. You need to delete it and recreate it from the name manager. Just go to the name manager and click the new button, then select the sheet you want to have the name in (see screenshot).

    You can read more about scopes here:
    LVL 44

    Expert Comment

    by:Martin Liss
    You cannot change the scope once the name is created

    Sorry but that's not correct. Either go to the Name Manager and click the Edit button at the top and then change what's in 'Refers to' or click the tiny spreadsheet-like button near the lower righthand corner and that will take you to a 'Refers to' box where you can make the change.
    LVL 44

    Expert Comment

    by:Martin Liss
    Oops. I didn't notice that you were talking about the scope rather than the range itself.
    LVL 20

    Expert Comment

    Exactly ;-)
    LVL 17

    Expert Comment

    If you want to automate this, try this VBA code.  It takes as a parameter the name of a Name with workbook scope, and changes it to local worksheet scope.  Obviously this would fail if the named range did not refer to a valid range,

    Public Sub ChangeScopeToLocal(ByVal strGlobalName As String)
        Dim n As Excel.Name
        Dim r As Excel.Range
        Dim strName As String
        Set n = ActiveWorkbook.Names(strGlobalName)
        Set r = n.RefersToRange
        strName = n.Name
        r.Worksheet.Names.Add Name:=strName, RefersTo:=r
    End Sub
    Public Sub Test()
        ChangeScopeToLocal "Stuart"
    End Sub

    Open in new window


    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Suggested Solutions

    Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
    Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
    This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now