Example #1
0
        /// <summary>
        /// Translate an address from R1C1 to A1
        /// </summary>
        /// <param name="r1C1Address">The address</param>
        /// <param name="row">The row of the cell to calculate from</param>
        /// <param name="col">The column of the cell to calculate from</param>
        /// <returns>The address in A1 notation</returns>
        public static string FromR1C1(string r1C1Address, int row, int col)
        {
            if (ExcelAddress.IsTableAddress(r1C1Address))
            {
                return(r1C1Address);
            }
            var addresses = ExcelAddressBase.SplitFullAddress(r1C1Address);
            var ret       = "";

            foreach (var address in addresses)
            {
                ret += ExcelCellBase.GetFullAddress(address[0], address[1], FromR1C1SingleAddress(address[2], row, col)) + ",";
            }
            return(ret.Length == 0?"":ret.Substring(0, ret.Length - 1));
        }