You are here

public function PHPExcel_Worksheet::insertNewColumnBeforeByIndex 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::insertNewColumnBeforeByIndex()

Insert a new column, updating all possible related data

Parameters

int $pBefore Insert before this one (numeric column coordinate of the cell):

int $pNumCols Number of columns to insert:

Return value

PHPExcel_Worksheet

Throws

PHPExcel_Exception

File

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

Class

PHPExcel_Worksheet
PHPExcel_Worksheet

Code

public function insertNewColumnBeforeByIndex($pBefore = 0, $pNumCols = 1) {
  if ($pBefore >= 0) {
    return $this
      ->insertNewColumnBefore(PHPExcel_Cell::stringFromColumnIndex($pBefore), $pNumCols);
  }
  else {
    throw new PHPExcel_Exception("Columns can only be inserted before at least column A (0).");
  }
}