Identifying the merged cell in the specified range

Hi, I want to validate Excel file, if the excel sheet has Merger cells(This I can do by taking Merged cell count) I want to validate, if there are any merged cells in the Specified Range..like from 3rd column to 5th column. How can I do this..? Thanks and Regards, Prathima

2 Replies

AD Administrator Syncfusion Team November 29, 2005 05:45 AM UTC

Hi Prathima, I have logged a feature request for this issue Feature id:#583. It will be available in the next release. The next release is in the first week of december. Thanks for your interest with Syncfusion Products. Best Regards, Seetha >Hi, > >I want to validate Excel file, if the excel sheet has Merger cells(This I can do by taking Merged cell count) >I want to validate, if there are any merged cells in the Specified Range..like from 3rd column to 5th column. >How can I do this..? > >Thanks and Regards, >Prathima


AD Administrator Syncfusion Team November 29, 2005 11:39 AM UTC

Hi Prathima, Here is some sample code that retrieves the merged cells in a given Range //First Approach //Get Merged cells in a given Range [This range covers all used cells in columns //3 to 5) foreach(IRange range in sheet.Range[1,3,sheet.UsedRange.End.Row,5].Cells) { if(range.IsMerged) { range.Text = range.Address; } } //Second Approach foreach(IRange range in sheet.MergedCells) { if(range.Column >= 3 && range.Column <= 5) { range.Text = range.Address; } } Here is a sample F37616.zip Please let me know if you have any questions. Thanks, Stephen.

Loader.
Up arrow icon