Aspose::Cells::Range::AutoFill method

Range::AutoFill(const Range&) method

Automaticall fill the target range.

void Aspose::Cells::Range::AutoFill(const Range &target)
ParameterTypeDescription
targetconst Range&the target range.

Examples

Aspose::Cells::Startup();
//Instantiating a Workbook object
Workbook workbook;
// Get the first Worksheet Cells.
Cells cells = workbook.GetWorksheets().Get(0).GetCells();
cells.Get(u"A1").PutValue(1);
cells.Get(u"A2").PutValue(2);
Range source = cells.CreateRange(u"A1:A2");
Range targetRange = cells.CreateRange(u"A3:A10");
//fill 3,4,5....10 to the range A3:A10
source.AutoFill(targetRange);
//Save the Excel file
workbook.Save(u"book1.xlsm");
Aspose::Cells::Cleanup();

See Also

Range::AutoFill(const Range&, AutoFillType) method

Automaticall fill the target range.

void Aspose::Cells::Range::AutoFill(const Range &target, AutoFillType autoFillType)
ParameterTypeDescription
targetconst Range&The targed range.
autoFillTypeAutoFillTypeThe auto fill type.

See Also