ExcelScript.AutoFillType enum

The behavior types when AutoFill is used on a range in the workbook.

Remarks

Examples

/**
 * This script uses the autofill feature to complete a table with days of the month.
 * See https://support.microsoft.com/office/74e31bdd-d993-45da-aa82-35a236c5b5db
 * for examples of autofill scenarios.
 */
function main(workbook: ExcelScript.Workbook) {
  // Get the current, active worksheet.
  let currentWorksheet = workbook.getActiveWorksheet();

  // Get the data range that shows the pattern.
  let dataRange = currentWorksheet.getRange("C2:C3");

  // Autofill the connected range. C2:C3 are filled in with dates. C4:C54 are blank.
  dataRange.autoFill("C2:C54", ExcelScript.AutoFillType.fillDays);
}

Fields

fillCopy

Populates the adjacent cells with data based on the selected data.

fillDays

A version of "FillSeries" for dates that bases the pattern on either the day of the month or the day of the week, depending on the context.

fillDefault

Populates the adjacent cells based on the surrounding data (the standard AutoFill behavior).

fillFormats

Populates the adjacent cells with the selected formats.

fillMonths

A version of "FillSeries" for dates that bases the pattern on the month.

fillSeries

Populates the adjacent cells with data that follows a pattern in the copied cells.

fillValues

Populates the adjacent cells with the selected values.

fillWeekdays

A version of "FillSeries" for dates that bases the pattern on the day of the week and only includes weekdays.

fillYears

A version of "FillSeries" for dates that bases the pattern on the year.

flashFill

Populates the adjacent cells by using Excel's Flash Fill feature.

growthTrend

A version of "FillSeries" for numbers that fills out the values in the adjacent cells according to a growth trend model.

linearTrend

A version of "FillSeries" for numbers that fills out the values in the adjacent cells according to a linear trend model.