移动工作表中的单元格范围

在工作表中移动单元格范围

示例代码使用模板文件演示了该任务。

输入文件

todo:image_alt_text

请参阅以下生成的文件,范围 A1:B5 移动到 C1:D5。

输出文件

todo:image_alt_text

// Instantiate the workbook object. Open the Excel file
Workbook workbook = new Workbook("book1.xlsx");
Cells cells = workbook.Worksheets[0].Cells;
Range range = cells.CreateRange("A1", "B5");
//move the range to right.
range.MoveTo(0, 2);
view raw Move-Range.cs hosted with ❤ by GitHub