Hello there
I'm currently working on a function that will dynamically assign values to the column range of AE to "AD" + i. However, when I use the function provided below, it only writes AD5 into the first 5 columns instead of AD1, AD2, AD3, and so on...
for (let i =1; i <=5; i++) {
// Set AE2 to AE5.
let rowID = range.setValue("AD" + i);
}
I know there is probably a simple solution to this issue. Any help or suggestions would be greatly appreciated!
Below is the complete code for reference:
function main(workbook: ExcelScript.Workbook, sheetName: string, address: string, base64ImageString: string) {
let sheet = workbook.getWorksheet(sheetName);
let range = sheet.getRange("AE2:AE5");
for (let i =2; i <=5; i++) {
// Set AE2 to AE5.
let rowID = range.setValue("AD" + i);
}
}
Thank you in advance!