How to get the correct range to set the value to a cell? Ask Question

How to get the correct range to set the value to a cell? Ask Question

I want to set text or number in Google Sheet from script.

I want to set Hello or number 9 in cell F2. I found this code so far:

SpreadsheetApp.getActiveRange().setValue('hello');

but that doesn't specify which cell.

ベストアンサー1

The following code does what is required

function doTest() {
  SpreadsheetApp.getActiveSheet().getRange('F2').setValue('Hello');
}

おすすめ記事