Skip to main content


sets a value for a cell

setValue: (cell: string, value: any | any[]) => void;


  • cell: string - the id(s) of a cell(s) or a range of cells
  • value: string | number | array - the value(s) to be set for cells


// setting value for one cell
// setting the same value for a range of cells
// setting the same value for different cells
// setting values from an array for cells in a range alternately

1. The method allows setting the same/repeated value(s) for the specified cells. In case you want to add different values into spreadsheet cells, you'd better use the parse() method.

Related sample: Spreadsheet. Initialization with multiple sheets

2. Starting with v4.1, the reference to a cell or range of cells can be specified in the following format:


where sheet1 is the name of the tab.

In case the name of the tab isn't specified, the method will set the value(s) for the cell(s) of the active tab.