/// <summary> /// Convert range address into cell address style if the range is a merged cell (A1:A1 => A1) /// </summary> /// <param name="sheet">Worksheet instance used to check whther or not the range is a merged cell</param> /// <param name="range">Range to be converted</param> /// <returns>Single cell address if convert is successful; otherwise return the range address</returns> public static string ToSingleAddressIfPossible(Worksheet sheet, RangePosition range) { return((sheet.IsMergedCell(range)) ? range.StartPos.ToAddress() : range.ToAddress()); }