NamedRange::AutoFill Method (Range^, XlAutoFillType)

 

Automatically fills the cells in the NamedRange control.

Namespace:   Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)

Object^ AutoFill(
	Range^ Destination,
	XlAutoFillType Type = XlAutoFillType::xlFillDefault
)

Parameters

Destination
Type: Microsoft.Office.Interop.Excel::Range^

The cells to be filled. The destination must include the source range.

Type
Type: Microsoft.Office.Interop.Excel::XlAutoFillType

Specifies the fill type.

Can be one of these XlAutoFillType values:

xlFillDays

xlFillFormats

xlFillSeries

xlFillWeekdays

xlGrowthTrend

xlFillCopy

xlFillDefault

xlFillMonths

xlFillValues

xlFillYears

xlLinearTrend

If this argument is xlFillDefault or omitted, Microsoft Office Excel selects the most appropriate fill type, based on the source range.

Return Value

Type: System::Object^

For information on optional parameters, see Optional Parameters in Office Solutions.

The following code example sets the value 5 in cell A1, and then uses the AutoFill method to automatically fill cells A1 through A20 with the value in cell A1.

This example is for a document-level customization.

No code example is currently available or this language may not be supported.
Return to top
Show: