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.