// Paste into Excel for the web: Automate → New Script
function main(workbook: ExcelScript.Workbook) {
  const sheet = workbook.getActiveWorksheet();
  const used = sheet.getUsedRange();
  if (!used) return;
  const header = used.getRow(0);
  header.getFormat().getFont().setBold(true);
  header.getFormat().getFill().setColor("#217346");
  header.getFormat().getFont().setColor("white");
  const body = used.getOffsetRange(1, 1).getResizedRange(-1, -1);
  body.setNumberFormatLocal("#,##0");
  sheet.getFreezePanes().freezeRows(1);
  used.getFormat().autofitColumns();
}
