Microsoft Office Tutorials and References
In Depth Information
19.3.21 Precedents and DirectPrecedents Properties
19.3.21 Precedents and DirectPrecedents Properties
These properties work just like the Dependents and DirectDependents properties, but in the
reverse direction. For instance, referring to Figure 19-12 , the line:
Range("C6").Precedents.Select
selects the cells B1 and A1, whereas the line:
Range("C6").DirectPrecedents.Select
selects the cell B1.
19.3.22 End Property
This property returns a Range object that represents the cell at the "end" of the region that contains
the source range by mimicking a keystroke combination (see the following code). The syntax is:
RangeObject .End( Direction )
where RangeObject should be a reference to a single cell and Direction is one of the
following constants. (The keystroke combination is also given in the following code.)
Enum XlDirection
xlUp = -4162 ' Ctrl-Up
xlToRight = -4161 ' Ctrl-Right
xlToLeft = -4159 ' Ctrl-Left
xlDown = -4121 ' Ctrl-Down
End Enum
Thus, for instance, the code:
Range("C4").End(xlToRight).Select
selects the rightmost cell in Row 4 for which all cells between that cell and cell C4 are nonempty
(that is, the cell immediately to the left of the first empty cell in row 4 following cell C4).
19.3.23 EntireColumn and EntireRow Properties
The EntireColumn property returns a Range object that represents the column or columns that
contain the specified range. The EntireRow property returns a Range object that represents the
row or rows that contain the specified range.
For instance, the code:
Range("A1:A3").EntireRow.Select
selects the first three rows of the current worksheet.
19.3.24 Fill Methods
The Excel object model has four Fill methods: FillDown, FillUp, FillLeft, and FillRight. As
expected, these methods work similarly, so we will describe only FillDown.
Search JabSto ::




Custom Search