public static Excel.Range GetRange(ref Excel._Worksheet Sheet, string FirstColumn, int FirstRow, string LastColumn, int LastRow) { return(Sheet.get_Range(string.Format("{0}{1}", FirstColumn, FirstRow), string.Format("{0}{1}", LastColumn, LastRow))); }
/// <summary> /// Returns the specified range object /// </summary> /// <param name="Sheet">Excel Worksheet reference</param> /// <param name="FirstColumn">Range's first columns's identifier, in case of a number this is a 1 based index.</param> /// <param name="FirstRow">Range's first row's identifier, in case of a number this is a 1 based index.</param> /// <param name="LastColumn">Range's last column's identifier, in case of a number this is a 1 based index.</param> /// <param name="LastRow">Range's last row's identifier, in case of a number this is a 1 based index.</param> /// <returns></returns> public static Excel.Range GetRange(ref Excel._Worksheet Sheet, int FirstColumn, int FirstRow, int LastColumn, int LastRow) { return(Sheet.get_Range(string.Format("{0}{1}", GetColumnLetter(FirstColumn - 1), FirstRow), string.Format("{0}{1}", GetColumnLetter(LastColumn - 1), LastRow))); }