Results 1 to 10 of 12

Thread: Named Ranges and Named Ranges scope. Referencing a named range

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    _..... Initial conclusions from first post





    Initial Conclusions: What is named ranges and named ranges scope
    An important final point here to avoid confusion later: Scope in named ranges is not talking about where the actual range that it Refers To is. The named ranges scope concept, as it is usually explained, seems to come out as a by product of what Excel adds by default
    From our VBA considerations, we can see a clear definition of what is known as the two "scopes" when talking about named ranges

    Worksheets Scope: The information about the named range is held, ( or probably more correct technically a reference to where to find all that is ) in a particular worksheet's collection object of Name objects. Somehow, probably by virtue of the hierarchical structure, this info is duplicated in the corresponding workbook's collection of named objects object. But it is a good guess that Excel probably "goes" by default to find information it needs "at the worksheet", in situations when you don't specify otherwise.
    The information about the named range can be "got at" through referencing the Work sheet Name object that it "belongs to" , or the Workbook Names Object . We can define which of the Work sheet Name object it should "belong to". We call this "scoping to a worksheet" and say that the name object is then "scoped to" the chosen Work sheet
    !!!Note: The "scoped" worksheet does not have to be that in which the named range is. In fact , it can even be a worksheet in another workbook..

    Workbooks Scope The information about the named range is held, ( or probably more correct technically a reference to where to find all that is ) in a particular workbook's collection object of Name objects. It is a good guess that Excel probably "goes" by default to find information it needs "at that workbook", in situations when you don't specify otherwise. ( Possibly, by virtue of the hierarchical structure, if you specify to "look" in a worksheet , ( belonging to that workbook) , by something like arange reference rather than a specific reference to a worksheet's collection of named ranges, then that may get you to the information at the workbook's collection of named objects object)
    The information about the named range can only be "got at" through referencing a Workbook Names Object. We call this "scoping to a workbook" and say that the name object is then "scoped to" the Workbook.
    Note: The "scoped" workbook does not have to be that in which the named range is. It can be another workbook
    Last edited by DocAElstein; 09-24-2019 at 06:33 PM.

Similar Threads

  1. populate control from named range stored in addin
    By MrBlackd in forum Excel Help
    Replies: 8
    Last Post: 05-11-2016, 04:46 PM
  2. Replies: 15
    Last Post: 01-07-2014, 12:42 AM
  3. Automatically Create Multiple Dynamic Named Ranges Using VBA
    By Rajan_Verma in forum Rajan Verma's Corner
    Replies: 0
    Last Post: 04-24-2013, 03:49 PM
  4. Add Named Ranges To Multiple Workbooks Using VBA
    By Stalker in forum Excel Help
    Replies: 5
    Last Post: 04-23-2013, 12:20 PM
  5. Detect Duplicates In Named Ranges With Cross Check
    By Yegarboy in forum Excel Help
    Replies: 3
    Last Post: 10-09-2012, 11:02 AM

Posting Permissions

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