Excel文件的自动填充范围
Contents
[
Hide
]
在Excel中指定范围执行自动填充
在Excel中,选择一个范围,将鼠标移动到右下角,拖动“+”以自动填充数据。
使用Aspose.Cells自动填充范围
以下示例显示如何对Range执行自动填充操作,这里是可用于测试此功能的示例文件的下载链接:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
//Create a Workbook | |
Aspose.Cells.Workbook workbook = new Workbook("range_autofill.xlsx"); | |
//Get Cells | |
Aspose.Cells.Cells cells = workbook.Worksheets[0].Cells; | |
//Create Range | |
Aspose.Cells.Range src = cells.CreateRange("C3:C4"); | |
Aspose.Cells.Range dest = cells.CreateRange("C5:C10"); | |
//AutoFill | |
src.AutoFill(dest, AutoFillType.Series); | |
//Save the Workbook | |
workbook.Save("range_autofill_result.xlsx"); |