checking merged cells

Topics: Developer Forum, User Forum
Feb 14, 2010 at 1: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 ?

Feb 14, 2010 at 10: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 6:45 AM
Here's code from an SO answer doing exactly what Mark said (in case it helps someone later):