Intervallo di riempimento automatico del file Excel

Eseguire un riempimento automatico nell’intervallo specificato in Excel

In Excel, selezionare un intervallo, spostare il mouse in basso a destra, trascinare “+” per compilare automaticamente i dati.

Intervalli di riempimento automatico con Aspose.Cells

L’esempio seguente mostra come eseguire l’operazione di riempimento automatico nell’intervallo, ed ecco il file di esempio che può essere scaricato per testare questa funzione:

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");