Page 191 - Microsoft Office Excel 2003 Programming Inside Out
P. 191

Part 3:  The Excel Object Model
                                                       Ranges and Cells


                             Inside Out

                             How Excel Extends a Range
                             When searching for a cell that matches one of the special cell types listed in Table 8-1,
                             Excel begins searching at the active cell. From there, it searches to the right and downward,
                             performing a greedy search, selecting as many cells as needed to reach the farthest cell
                             that meets the criteria. If no cells are found, Excel changes the search direction and
                             switches to a lazy search, returning the first cell that matches.
                                                                                                             Chapter 8
                             Excel will continue searching to the right, looking upward instead of downward for a match.
                             If no matching cells are found, Excel will then search to the left. Again, Excel searches
                             downward first and then upward.
                             To figure out which cells Excel will select, remember the following rules:
                               ●  Right first, left second.
                               ●  Down first, up second.
                               ●  Right-down is a greedy search; all others are lazy searches.









































                                                                                                       165
   186   187   188   189   190   191   192   193   194   195   196