create column-based onedit handler

This commit is contained in:
Ben Miller
2024-11-17 09:28:53 -07:00
parent d6d6af3c44
commit 9d234c77d9
6 changed files with 52 additions and 9 deletions

View File

@ -85,3 +85,12 @@ export function getRowByColumnValue(
console.log("row found: " + resultRow)
return resultRow
}
export function getColumnName(sheetName: string, col: number) {
let sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName)
if (!sheet) {
return
}
let headers = sheet.getRange("A1:1").getValues()
return String(headers[0][col-1])
}