JunDotz
JunDotz

Reputation: 131

getCellByColumnAndRow unable to retrieve data on merge cells

I'm new on PHPExcel. I just want to know if it's possible to retrieve data from a merge cells using the function getCellByColumnAndRow().

I'm trying to retrieve data from a merge cells using row and column number. I used this:

$excel->getActiveSheet()->getCellByColumnAndRow(1,1)->getValue()

but it doesn't return any value or error, and when I tried to use this:

excel->getActiveSheet()->getCell('A1')->getValue()

It returns the value. What's the solution?

Cells A1 to D1 were merge in my Excel file.

Upvotes: 0

Views: 4928

Answers (1)

JunDotz
JunDotz

Reputation: 131

I Already found the solution. Index column number starts at 0 and not 1.

So if you want to get the value of cell A1 then the code should be:

$excel->getActiveSheet()->getCellByColumnAndRow(0,1)->getValue()

Thank you.

Upvotes: 1

Related Questions