We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to get excel merge count.

In my excel sheet. I''ve merge A1:A9. When I using ExcelRW read Range[A1]. How do I knrow colspan. Anybody know can tell me.

3 Replies

GR Greg September 30, 2004 08:23 AM

Personally, I scan through the merged section before accessing individual cells. You might put this info in a collection to test against when you read each cell. Maybe SyncFusion has a better recommendation. foreach (IRange ecell in wk.MergedCells) { top = ecell.Row; left = ecell.Column; bottom = top + ecell.Rows.Length - 1; right = left + ecell.Columns.Length - 1; }


AD Administrator Syncfusion Team September 30, 2004 09:25 AM

Hi, Thanks for your input Greg. We have added a new property IRange.MergeArea which will return a Range that encapsulates the Merged cells. Unfortunately we do not have an updated evaluation version available right now, so please open a Direc-Trac incident in this regard and I will try to provide you with an updated evaluation version as soon as possible. Thanks. Best regards, Stephen. >Personally, I scan through the merged section before accessing individual cells. You might put this info in a collection to test against when you read each cell. Maybe SyncFusion has a better recommendation. > > foreach (IRange ecell in wk.MergedCells) > { > > top = ecell.Row; > left = ecell.Column; > bottom = top + ecell.Rows.Length - 1; > right = left + ecell.Columns.Length - 1; >}


VD Vu Dang Quang October 1, 2004 10:02 PM

Thanks for Greg. I''ve try using it code and it works good. vdquang >Personally, I scan through the merged section before accessing individual cells. You might put this info in a collection to test against when you read each cell. Maybe SyncFusion has a better recommendation. > > foreach (IRange ecell in wk.MergedCells) > { > > top = ecell.Row; > left = ecell.Column; > bottom = top + ecell.Rows.Length - 1; > right = left + ecell.Columns.Length - 1; >}

Loader.
Live Chat Icon For mobile
Up arrow icon