Skip to content

Commit

Permalink
Merge pull request #45 from devOp1/master
Browse files Browse the repository at this point in the history
Fixed column numbering on setCellValue() to 1-based
  • Loading branch information
mikehaertl authored Jan 18, 2023
2 parents d430c46 + 69e67d9 commit 133df7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ExcelSheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,12 @@ protected function normalizeIndex($data)
/**
* @param int|string $column the column either as int or as string. If
* numeric, the startColumn offset will be added.
* @return int the normalized numeric column index (0-based).
* @return int the normalized numeric column index (1-based).
*/
public function normalizeColumn($column)
{
if (is_string($column)) {
return \PhpOffice\PhpSpreadsheet\Cell\Coordinate::columnIndexFromString($column) - 1;
return \PhpOffice\PhpSpreadsheet\Cell\Coordinate::columnIndexFromString($column);
} else {
return $column + self::normalizeColumn($this->startColumn);
}
Expand Down

0 comments on commit 133df7a

Please sign in to comment.