ExcelScript.AutoFillType enum
对工作簿中的某个区域使用自动填充时的行为类型。
注解
示例
/**
* 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);
}
字段
fillCopy | 使用基于所选数据的数据填充相邻单元格。 |
fillDays | 日期的“FillSeries”版本,该模式基于月份的哪一天或星期几,具体取决于上下文。 |
fillDefault | 根据周围的数据 (标准自动填充行为) 来填充相邻单元格。 |
fillFormats | 使用所选格式填充相邻单元格。 |
fillMonths | “FillSeries”的一个版本,用于将模式基于月份的日期。 |
fillSeries | 使用复制单元格中遵循模式的数据填充相邻单元格。 |
fillValues | 使用所选值填充相邻单元格。 |
fillWeekdays | “FillSeries”的一个版本,用于日期,该模式基于星期几,并且仅包括工作日。 |
fillYears | “FillSeries”的一个版本,用于基于年份的日期模式。 |
flashFill | 使用 Excel 的快速填充功能填充相邻单元格。 |
growthTrend | “FillSeries”的一个版本,用于根据增长趋势模型填充相邻单元格中的值的数字。 |
linearTrend | “FillSeries”的一个版本,用于根据线性趋势模型填充相邻单元格中的值的数字。 |