You are here

public static function PHPExcel_Cell::stringFromColumnIndex 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::stringFromColumnIndex()

* String from columnindex * *

Parameters

int $pColumnIndex Column index (base 0 !!!): * @return string

73 calls to PHPExcel_Cell::stringFromColumnIndex()
40duplicateStyle.php in vendor/phpoffice/phpexcel/Examples/40duplicateStyle.php
PHPExcel_CachedObjectStorage_CacheBase::getHighestColumn in vendor/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/CacheBase.php
* Get highest worksheet column *
PHPExcel_Calculation::_processTokenStack in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation.php
PHPExcel_Calculation_LookupRef::CELL_ADDRESS in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/LookupRef.php
* CELL_ADDRESS * * Creates a cell address as text, given specified row and column numbers. * * Excel Function: * =ADDRESS(row, column, [relativity], [referenceStyle], [sheetText]) * *
PHPExcel_Calculation_LookupRef::OFFSET in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/LookupRef.php
* OFFSET * * Returns a reference to a range that is a specified number of rows and columns from a cell or range of cells. * The reference that is returned can be a single cell or a range of cells. You can specify the number of rows and * the…

... See full list

File

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

Class

PHPExcel_Cell
PHPExcel_Cell

Code

public static function stringFromColumnIndex($pColumnIndex = 0) {

  //	Using a lookup cache adds a slight memory overhead, but boosts speed
  //	caching using a static within the method is faster than a class static,
  //		though it's additional memory overhead
  static $_indexCache = array();
  if (!isset($_indexCache[$pColumnIndex])) {

    // Determine column string
    if ($pColumnIndex < 26) {
      $_indexCache[$pColumnIndex] = chr(65 + $pColumnIndex);
    }
    elseif ($pColumnIndex < 702) {
      $_indexCache[$pColumnIndex] = chr(64 + $pColumnIndex / 26) . chr(65 + $pColumnIndex % 26);
    }
    else {
      $_indexCache[$pColumnIndex] = chr(64 + ($pColumnIndex - 26) / 676) . chr(65 + ($pColumnIndex - 26) % 676 / 26) . chr(65 + $pColumnIndex % 26);
    }
  }
  return $_indexCache[$pColumnIndex];
}