Range name applies to list, or simply range?

P

paul.domaskis

In Excel 2003, if I go through the pull-down menus to define a range
name, I can see the bounding spreadsheet coordinates for the various
named ranges. (Don't have access to the machine with Excel at the
moment, so sorry if this is a bit vague, but I think the menu
traversals might be something like Insert->Name->Define).

Is there a way to determine whether the names apply to a simple range,
or a list? Currently, my way of testing that is to insert rows into a
list and see whether the range coordinates for the list name changes.
There must be a more direct way than to muss around with my list.

Thanks.
 
P

paul.domaskis

I can see the selection if type in the name (or even just click on the
name in the list). That selects the range. It still doesn't indicate
whether the name is attached to a fixed boundary range, or a dynamic
boundary list.
 
D

Don Guillett

If it is a defined name you will not see it in the list. So,
insert>name>define>
now you will see the list for all (if not hidden by vba)

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
I can see the selection if type in the name (or even just click on the
name in the list). That selects the range. It still doesn't indicate
whether the name is attached to a fixed boundary range, or a dynamic
boundary list.
 
P

paul.domaskis

I must be doing something different from what you have in mind. When
I do Insert->Name->Define, I see the named ranges, including the names
that I'm not sure whether they are attached to fixed ranges, or list
ranges). When I click F5, I also see those names.

Furthermore, I did some tests in VBA., where "TheName" is the name
which I'm not sure refers to a List or a fixed Range.

Works:
nRows = _
Sheets("SheetName").ListObjects(1).ListRows.Count

Works:
nRows = _
Sheets("SheetName").Range("TheName").Rows.Count

Doesn't Work:
nRows = _
Sheets("SheetName").ListObjects("TheName").ListRows.Count

The fact that "TheName" isn't accepted as an index to collection
ListObjects implies (doesn't prove) that "TheName" is associated with
fixed Range rather than a list. However, when I add/remove rows to/
from the list in Excel, the range associated with "TheName" updates
accordingly. Would you have any insight that can help make sense of
this?

I also was wondering about operator precedence. It seems that the
member-of function (the dot/period) has the same precedence as the
collection indexing function (brackets following a collection name,
enclosing either a numerical or string index). These seem to be
evaluated from left to right. Is this correct?

Finally, where is it documented what arguments accepted within the
indexing brackets for a ListObjects collection? In C++/STL, there
would be constructors for this, but this is a different environment
that I am still trying to get the subtleties of.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top