Common Members
Most objects in Excel have several members in common as listed in Table 4-5.
Table 4-5. Common Excel object members
|
Member |
Description |
Use to |
|---|---|---|
|
|
Returns the Excel |
This isn’t really useful from within Excel since the |
|
|
Returns a numeric code identifying the application that created the object |
Again, this isn’t really useful from within Excel. You can pretty much ignore this property. |
|
|
Returns the next-higher object in Excel’s object hierarchy |
Map Excel’s object hierarchy. |
|
Name |
Returns a string describing the object |
Display information about an object or get a specific object from a collection. |
You might be able to tell from Table 4-5 that the Name property is the most useful of the common members
. Most (but not all) Excel objects have a Name property that identifies the object within its containing collection. For example, Worksheets("Sheet1") returns the worksheet with the Name property Sheet1.
That’s not true for all objects, however. The Range object, for instance, has an Address property instead of a Name property. Other objects, such as Window, use the Caption property, instead. Table 4-6 categorizes some of the common members that aren’t as universal as those listed in Table 4-5, but are actually more useful to know.
Table 4-6. Other useful, common members by category ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access