text: public CellReference[] GetAllReferencedCells(){if (_isSingleCell){return new CellReference[] { _firstCell, };}int minRow = Math.Min(_firstCell.Row, _lastCell.Row);int maxRow = Math.Max(_firstCell.Row, _lastCell.Row);int minCol = Math.Min(_firstCell.Col, _lastCell.Col);int maxCol = Math.Max(_firstCell.Col, _lastCell.Col);String sheetName = _firstCell.SheetName;ArrayList refs = new ArrayList();for (int row = minRow; row <= maxRow; row++){for (int col = minCol; col <= maxCol; col++){CellReference ref1 = new CellReference(sheetName, row, col, _firstCell.IsRowAbsolute, _firstCell.IsColAbsolute);refs.Add(ref1);}}return (CellReference[])refs.ToArray(typeof(CellReference));}