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

The scope is grayed out when I edit a named range.  How can I change the scope when editing a range? (See graphic)
 err
brothertruffle880Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TheAvengerCommented:
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: http://office.microsoft.com/en-us/excel-help/define-and-use-names-in-formulas-HA010147120.aspx
Untitled.jpg
Noname.jpg

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Martin LissOlder than dirtCommented:
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.
Martin LissOlder than dirtCommented:
Oops. I didn't notice that you were talking about the scope rather than the range itself.
TheAvengerCommented:
Exactly ;-)
andrewssd3Commented:
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
    
    n.Delete
    
    r.Worksheet.Names.Add Name:=strName, RefersTo:=r

End Sub


Public Sub Test()

    ChangeScopeToLocal "Stuart"

End Sub

Open in new window

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.