I have values in range A1:E10 and I'd like to get the next empty column in that range (excluding headers). In this case last column used is "C" and next empty column would be "D".
My curren code only gets the last column index in all used range, but I don`t know how to get the last column letter in specific range.
function main(workbook: ExcelScript.Workbook) {
const mysheet = workbook.getWorksheet("Sheet1");
const usedRange = mysheet.getUsedRange(true);
const LastCol = usedRange.getLastColumn().getColumnIndex();
console.log(Last column: " + LastCol);
}
