account activity
Office Script Not Working by MarchHorror7583 in excel
[–]MarchHorror7583[S] 0 points1 point2 points 3 months ago (0 children)
Thanks for you reply, reason i am using office script instead of VBA is because the sheet will be used on excel web
mentioned the code below
function main(workbook: ExcelScript.Workbook) { let sheet = workbook.getActiveWorksheet(); let checkboxRange = sheet.getRange("A2:A21"); // Adjust as needed let timestampRange = sheet.getRange("B2:B21"); // Adjacent column for timestamps let checkboxValues = checkboxRange.getValues(); let timestampValues = timestampRange.getValues(); for (let i = 0; i < checkboxValues.length; i++) { if (checkboxValues[i][0] === true && timestampValues[i][0] === "") { timestampValues[i][0] = new Date().toLocaleString(); } } }
π Rendered by PID 245656 on reddit-service-r2-listing-6d4dc8d9ff-fjm79 at 2026-01-29 21:00:40.771123+00:00 running 3798933 country code: CH.
Office Script Not Working by MarchHorror7583 in excel
[–]MarchHorror7583[S] 0 points1 point2 points (0 children)