_..... 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




Reply With Quote
Bookmarks