I have about 10,000 rows of data and need to autofill the value 1,2,3...64 for 143 rows. So "1" will be autofilled for 143 rows, then "2" for 143 rows and so forth until the value "64" or any value. This would be all in the same column.
I currently have the code below re-written over 30 times. but I know I can condense this and save time.
let selectedSheet = workbook.getActiveWorksheet();
// Set range F2 on selectedSheet
selectedSheet.getRange("F2").setValue("1");
// Auto fill range
selectedSheet.getRange("F2").autoFill("F2:F143", ExcelScript.AutoFillType.fillDefault);
// Set range F144 on selectedSheet
selectedSheet.getRange("F144").setValue("2");
// Auto fill range
selectedSheet.getRange("F144").autoFill("F144:F285", ExcelScript.AutoFillType.fillDefault);
setValue
can update multiple cells all at once.for
loop is suitable for repeating the similar operation.