You are here

public function PHPExcel_Worksheet::unmergeCells in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet.php \PHPExcel_Worksheet::unmergeCells()

Remove merge on a cell range

Parameters

string $pRange Cell range (e.g. A1:E1):

Return value

PHPExcel_Worksheet

Throws

PHPExcel_Exception

1 call to PHPExcel_Worksheet::unmergeCells()
PHPExcel_Worksheet::unmergeCellsByColumnAndRow in vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet.php
Remove merge on a cell range by using numeric cell coordinates

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet.php, line 1742

Class

PHPExcel_Worksheet
PHPExcel_Worksheet

Code

public function unmergeCells($pRange = 'A1:A1') {

  // Uppercase coordinate
  $pRange = strtoupper($pRange);
  if (strpos($pRange, ':') !== false) {
    if (isset($this->_mergeCells[$pRange])) {
      unset($this->_mergeCells[$pRange]);
    }
    else {
      throw new PHPExcel_Exception('Cell range ' . $pRange . ' not known as merged.');
    }
  }
  else {
    throw new PHPExcel_Exception('Merge can only be removed from a range of cells.');
  }
  return $this;
}