public CellAddress(ExcelReference reference) : this(reference.SheetNameLocal(), reference.RowFirst, reference.RowLast, reference.ColumnFirst, reference.ColumnLast) { if (reference.InnerReferences.Count > 1) { throw new ArgumentException("CellAddress 只能包括一个区域"); } _cellReference = reference; }
/// <summary> /// 单元格范围地址 /// </summary> /// <param name="range"></param> /// <returns></returns> public static string Address(this ExcelReference range) { string sheetName = range.SheetNameLocal(); return($"{sheetName}!{range.AddressLocal()}"); }