I'm having quite an issue with this one - I have to detect horizontally and vertically merged cells from an excel table. I have to store the first cell coords, and the lenght of the merged area. I iterate through the table with two for-cycles, line by line.
How can I use MergeArea property to detect the merged and non-merged areas? If the cell is not merged, it should probably return empty range, however, this:
"If currentRange Is Nothing Then"
is not working at all. Any ideas? Thanks a lot.
If Not c.MergeArea Is Nothing
. You need to check the number of rows/columns, and you can find the top-left cell usingc.MergeArea.Cells(1)
– Tim Williams