示例#1
0
        public static ExcelRangeBase MoveColumn(this ExcelRangeBase cell, int offset)
        {
            var newCellIndex = cell.GetRangeIndex().MoveColumn(offset);
            var newCell      = cell.Worksheet.GetRange(newCellIndex);

            return(newCell);
        }
示例#2
0
        /// <summary>
        /// Expand the current range to new index, only expand row range
        /// </summary>
        /// <param name="cell">cell of current range</param>
        /// <param name="offset">positive for down expandation, negative for up expandation</param>
        /// <returns>The <paramref name="ExcelRangeBase"/> with new index</returns>
        public static ExcelRangeBase ExpandRow(this ExcelRangeBase cell, int offset)
        {
            var newCellIndex = cell.GetRangeIndex().ExpandRow(offset);
            var newCell      = cell.Worksheet.GetRange(newCellIndex);

            return(newCell);
        }
示例#3
0
        public static ExcelRangeBase MoveOffset(this ExcelRangeBase cell, string indecator, string FillOfX)
        {
            ExcelRangeBase newCell = null;

            if (indecator[1].Equals('X'))
            {
            }
            else
            {
                var index = int.Parse(indecator[1].ToString());

                if (indecator.Contains("v", "^"))
                {
                    if (indecator[0].Equals('^'))
                    {
                        index = -index;
                    }

                    var newCellIndex = cell.GetRangeIndex().MoveRow(index);
                    newCell = cell.Worksheet.GetRange(newCellIndex);
                }

                if (indecator.Contains("<", ">"))
                {
                    if (indecator[0].Equals('<'))
                    {
                        index = -index;
                    }

                    var newCellIndex = cell.GetRangeIndex().MoveColumn(index);
                    newCell = cell.Worksheet.GetRange(newCellIndex);
                }
            }

            return(newCell);
        }