checking merged cells

Topics: Developer Forum, User Forum
Feb 14, 2010 at 12:15 AM

I read other threads about checking if cell is merged, but still can't get how to do simple thing..

I have merged A1:A5 cells.

How to check it ?

Coordinator
Feb 14, 2010 at 9:36 AM

The PHPExcel_Worksheet::getMergeCells() method will retrieve a list of all the cell merges within the specified worksheet, giving you a set of ranges. You can then loop through that list, testing whether any given cell falls within one of those ranges using the PHPExcel_Cell::isInRange() method.

May 4, 2015 at 5:45 AM
Here's code from an SO answer doing exactly what Mark said (in case it helps someone later): http://stackoverflow.com/questions/7299756/phpexcel-how-to-check-if-current-cell-is-merged-with-another