You are here

public static function PHPExcel_Cell::absoluteReference in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell.php \PHPExcel_Cell::absoluteReference()

* Make string row, column or cell coordinate absolute * *

Parameters

string $pCoordinateString e.g. 'A' or '1' or 'A1': * Note that this value can be a row or column reference as well as a cell reference * @return string Absolute coordinate e.g. '$A' or '$1' or '$A$1' * @throws PHPExcel_Exception

2 calls to PHPExcel_Cell::absoluteReference()
PHPExcel_Writer_Excel2007_Workbook::_writeDefinedNameForNamedRange in vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007/Workbook.php
* Write Defined Name for named range * *
PHPExcel_Writer_Excel2007_Workbook::_writeDefinedNameForPrintArea in vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007/Workbook.php
* Write Defined Name for PrintTitles * *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell.php, line 601

Class

PHPExcel_Cell
PHPExcel_Cell

Code

public static function absoluteReference($pCoordinateString = 'A1') {
  if (strpos($pCoordinateString, ':') === FALSE && strpos($pCoordinateString, ',') === FALSE) {

    // Split out any worksheet name from the reference
    $worksheet = '';
    $cellAddress = explode('!', $pCoordinateString);
    if (count($cellAddress) > 1) {
      list($worksheet, $pCoordinateString) = $cellAddress;
    }
    if ($worksheet > '') {
      $worksheet .= '!';
    }

    // Create absolute coordinate
    if (ctype_digit($pCoordinateString)) {
      return $worksheet . '$' . $pCoordinateString;
    }
    elseif (ctype_alpha($pCoordinateString)) {
      return $worksheet . '$' . strtoupper($pCoordinateString);
    }
    return $worksheet . self::absoluteCoordinate($pCoordinateString);
  }
  throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells');
}