Skip to content

Commit 133df7a

Browse files
authored
Merge pull request #45 from devOp1/master
Fixed column numbering on setCellValue() to 1-based
2 parents d430c46 + 69e67d9 commit 133df7a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ExcelSheet.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,12 +307,12 @@ protected function normalizeIndex($data)
307307
/**
308308
* @param int|string $column the column either as int or as string. If
309309
* numeric, the startColumn offset will be added.
310-
* @return int the normalized numeric column index (0-based).
310+
* @return int the normalized numeric column index (1-based).
311311
*/
312312
public function normalizeColumn($column)
313313
{
314314
if (is_string($column)) {
315-
return \PhpOffice\PhpSpreadsheet\Cell\Coordinate::columnIndexFromString($column) - 1;
315+
return \PhpOffice\PhpSpreadsheet\Cell\Coordinate::columnIndexFromString($column);
316316
} else {
317317
return $column + self::normalizeColumn($this->startColumn);
318318
}

0 commit comments

Comments
 (0)