AutoFill range of Excel file

Perform an autofill in the specified range in Excel

In Excel, Select a range, Move mouse to right-bottom, drag “+” to autofill data .

Auto Fill Ranges with Aspose.Cells

The following example shows how to do AutoFill operation to the Range, and here is the sample file which can be downloaded for testing this feature:

range_autofill.xlsx

//Create a Workbook
Workbook workbook = new Workbook("range_autofill.xlsx");
//Get Cells
Cells cells = workbook.getWorksheets().get(0).getCells();
//Create Range
Range src = cells.createRange("C3:C4");
Range dest = cells.createRange("C5:C10");
//AutoFill
src.autoFill(dest, AutoFillType.SERIES);
//Save the Workbook
workbook.save("range_autofill_result.xlsx");