Officescript how to set value in table cell (row/column) by row index

Solution 1:

You can use getCell with the cRow variable after getRangeBetweenHeaderAndTotal() to get a specific cell range. Once you have that range, you can read its value using getValue(). And you can write a value to that range using setValue(). You can see an example of how to do that below:

function main(workbook: ExcelScript.Workbook)
{
  let cRow: number = 1;
  let tbl: ExcelScript.Table = workbook.getTable("table1");
  let rowCell: ExcelScript.Range = tbl.getColumnByName("SomeCol").getRangeBetweenHeaderAndTotal().getCell(cRow,0);
  let rowValue: string = rowCell.getValue() as string;
  rowCell.setValue("some updated value");
}