private function updateCellRange($pCellRange = 'A1:A1', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0)
    {
        if (!Coordinate::coordinateIsRange($pCellRange)) {
            throw new Exception('Only cell ranges may be passed to this method.');
        }

        // Update range
        $range = Coordinate::splitRange($pCellRange);
        $ic = count($range);
        for ($i = 0; $i < $ic; ++$i) {
            $jc = count($range[$i]);
            for ($j = 0; $j < $jc; ++$j) {
                if (ctype_alpha($range[$i][$j])) {
                    $r = Coordinate::coordinateFromString($this->updateSingleCellReference($range[$i][$j] . '1', $pBefore, $pNumCols, $pNumRows));
                    $range[$i][$j] = $r[0];
                } elseif (ctype_digit($range[$i][$j])) {
                    $r = Coordinate::coordinateFromString($this->updateSingleCellReference('A' . $range[$i][$j], $pBefore, $pNumCols, $pNumRows));
                    $range[$i][$j] = $r[1];
                } else {
                    $range[$i][$j] = $this->updateSingleCellReference($range[$i][$j], $pBefore, $pNumCols, $pNumRows);
                }
            }
        }

        // Recreate range string
        return Coordinate::buildRange($range);
    }
private function updateCellRange($pCellRange = 'A1:A1', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0)
    {
        if (!Coordinate::coordinateIsRange($pCellRange)) {
            throw new Exception('Only cell ranges may be passed to this method.');
        }

        // Update range
        $range = Coordinate::splitRange($pCellRange);
        $ic = count($range);
        for ($i = 0; $i < $ic; ++$i) {
            $jc = count($range[$i]);
            for ($j = 0; $j < $jc; ++$j) {
                if (ctype_alpha($range[$i][$j])) {
                    $r = Coordinate::coordinateFromString($this->updateSingleCellReference($range[$i][$j] . '1', $pBefore, $pNumCols, $pNumRows));
                    $range[$i][$j] = $r[0];
                } elseif (ctype_digit($range[$i][$j])) {
                    $r = Coordinate::coordinateFromString($this->updateSingleCellReference('A' . $range[$i][$j], $pBefore, $pNumCols, $pNumRows));
                    $range[$i][$j] = $r[1];
                } else {
                    $range[$i][$j] = $this->updateSingleCellReference($range[$i][$j], $pBefore, $pNumCols, $pNumRows);
                }
            }
        }

        // Recreate range string
        return Coordinate::buildRange($range);
    }
private function updateCellRange ( $ pCellRange = 'A1:A1' , $ pBefore = 'A1' , $ pNumCols = 0 , $ pNumRows = 0 ) { if ( ! Coordinate :: coordinateIsRange ( $ pCellRange ) ) { throw new Exception ( 'Only cell ranges may be passed to this method.' ) ; } // Update range $ range = Coordinate :: splitRange ( $ pCellRange ) ; $ ic = count ( $ range ) ; for ( $ i = 0 ; $ i < $ ic ; ++ $ i ) { $ jc = count ( $ range [ $ i ] ) ; for ( $ j = 0 ; $ j < $ jc ; ++ $ j ) { if ( ctype_alpha ( $ range [ $ i ] [ $ j ] ) ) { $ r = Coordinate :: coordinateFromString ( $ this -> updateSingleCellReference ( $ range [ $ i ] [ $ j ] . '1' , $ pBefore , $ pNumCols , $ pNumRows ) ) ; $ range [ $ i ] [ $ j ] = $ r [ 0 ] ; } elseif ( ctype_digit ( $ range [ $ i ] [ $ j ] ) ) { $ r = Coordinate :: coordinateFromString ( $ this -> updateSingleCellReference ( 'A' . $ range [ $ i ] [ $ j ] , $ pBefore , $ pNumCols , $ pNumRows ) ) ; $ range [ $ i ] [ $ j ] = $ r [ 1 ] ; } else { $ range [ $ i ] [ $ j ] = $ this -> updateSingleCellReference ( $ range [ $ i ] [ $ j ] , $ pBefore , $ pNumCols , $ pNumRows ) ; } } } // Recreate range string return Coordinate :: buildRange ( $ range ) ; }
Update cell range.

@param string $pCellRange Cell range    (e.g. 'B2:D4', 'B:C' or '2:3')
@param string $pBefore Insert before this one
@param int $pNumCols Number of columns to increment
@param int $pNumRows Number of rows to increment

@throws Exception

@return string Updated cell range
Update cell range .